Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jQuery .load()在 1.8 版中已弃用。
如果我想执行以下任务:
$(window).load(function () { // run code });
我将如何在 jQuery 1.9+ 中执行此操作?
这只是等效.on调用的快捷方式,因此请改用它:
.on
$(window).on('load', function () { // run code });
如果您不关心多个处理程序,则可以使用基本的window.onload = function....
window.onload = function...