jQuery的document.ready()是否有本机Javascript实现? [英] Is there a native Javascript implementation of jQuery's document.ready()?

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

问题描述

 $(document).onload()

由window.onload事件在内部实现

it's internally implemented by window.onload event

 $(document).ready()

实现它的原生JavaScript是什么?

what's the native javascript to implement it?

推荐答案

对于Mozilla,Opera和Webkit,jQuery绑定 DOMContentLoaded 事件,对于IE jQuery使用

For Mozilla, Opera and webkit, jQuery binds the DOMContentLoaded event, for IE jQuery uses the onreadystatechange event.

jQuery源代码上查看内部bindReady函数.

这篇关于jQuery的document.ready()是否有本机Javascript实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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