且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检查动态网页是否已完全加载的***方法是什么?

更新时间:2023-02-23 19:30:52

window.onload不是jQuery函数,而是DOM事件.

window.onload isn't a jQuery function, it's a DOM event.

如果使用jQuery,检查页面是否已加载的***方法是处理 ready 事件,该事件可以在各种方式

If using jQuery the best way to check whether the page is loaded is to handle the ready event which can be done in various ways

最短

$(function() {
    // DOM initialized
});

$.ready(function() {
    // DOM initialized
});

更长

$(document).ready(function() {
    // DOM initialized
});

最长

jQuery(document).ready(function() {
    // DOM initialized
});