在JQuery中使用这个很酷的onload函数
$(document).ready(function(){ // my stuff }
Run Code Online (Sandbox Code Playgroud)
我是否需要担心覆盖其他任何可能称之为的内容?
@OneNerd的回答是正确的,它只是添加到就绪队列中。该ready方法在 jQuery 中声明如下:
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// Add the callback
readyList.add( fn );
return this;
},
Run Code Online (Sandbox Code Playgroud)
参考: http: //code.jquery.com/jquery.js
| 归档时间: |
|
| 查看次数: |
843 次 |
| 最近记录: |