检查动态网页是否已完全加载的最佳方法是什么? [英] What is the best way to check if dynamic web pages are fully loaded?

查看:100
本文介绍了检查动态网页是否已完全加载的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只需要检查页面是否已加载(没有动态对象,在页面完全显示后可能会对其进行修改)

I only need to check that the page is loaded (without dynamic objects that might be modified after page appears fully)

我知道JQuery的功能:"ready()"

I know JQuery's function: "ready()"

在上述情况下此功能是否有用? 还有另一种/更好的方法吗?

Will this function be relevant in the described-above case? Is there another / better way?

推荐答案

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
});

这篇关于检查动态网页是否已完全加载的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆