在jQuery中监听document 是否 ready的操作:
$(document).ready(function() {
// let's get up in heeya
});
我们可以简化成:
$(function() {
// let's get up in heeya
});
我们可以看jQuery源码,可以看出上面两种写法是一样的:
// HANDLE: $(function)
// Shortcut for document ready
if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
JQuery 笔记
最新推荐文章于 2025-05-12 11:05:00 发布
1150

被折叠的 条评论
为什么被折叠?



