使用Onload还是准备好了? [英] Use Onload or ready?

查看:54
本文介绍了使用Onload还是准备好了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的申请中,我正在使用

In my application i am using

$(document).ready()

这和

$(document).onload()


推荐答案

<只有 ready =http://en.wikipedia.org/wiki/Document_Object_Model =nofollow noreferrer> DOM 已准备好,而 所有资源 包括 onload a href =http://en.wikipedia.org/wiki/Document_Object_Model =nofollow noreferrer> DOM ,图片,框架等已经加载。

The ready is triggered when only the DOM becomes ready while onload triggers when all resources of the page including DOM, images, frames, etc have loaded.

参见:

$(document).ready vs. $(window).lo广告

注意 ready jQuery不是原始的javascript,所以我假设你知道那种比较看似合乎逻辑。

Note that ready lies with jQuery not raw javascript so I assume you know that and that way comparison seems logical.

这篇关于使用Onload还是准备好了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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