什么是非jQuery等价的'$(document).ready()'? [英] What is the non-jQuery equivalent of '$(document).ready()'?

查看:109
本文介绍了什么是非jQuery等价的'$(document).ready()'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是非jQuery等价的 $(文档).ready()

What is the non-jQuery equivalent of $(document).ready()?

推荐答案

关于 $(document).ready()的好处是它在 window.onload 。加载功能等待所有内容加载,包括外部资源和图像。 $(document).ready 但是,当DOM树完成并且可以被操作时触发。如果你想准备好DOM,没有jQuery,你可以检查这个库。有人从jQuery中提取了 ready 部分。它很好很小,你可能会发现它很有用:

The nice thing about $(document).ready() is that it fires before window.onload. The load function waits until everything is loaded, including external assets and images. $(document).ready, however, fires when the DOM tree is complete and can be manipulated. If you want to acheive DOM ready, without jQuery, you might check into this library. Someone extracted just the ready part from jQuery. Its nice and small and you might find it useful:

已完全使用Google代码

这篇关于什么是非jQuery等价的'$(document).ready()'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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