【发布时间】:2012-02-23 16:25:17
【问题描述】:
我正在尝试消除对 jQuery 的依赖。我从 underscore.js 中窃取了一些我需要的函数,但在 DOM 加载后仍然需要我的代码以与 jQuery 相同的方式运行
原创
$(function(){
// all my code
})
想要的
var afterload = function(content){
// what goes here..?
}
afterload(function(){
// my code that should run after the DOM is loaded
})
【问题讨论】:
-
如果您查看 jQuery 源代码,检测文档准备就绪比您想象的要困难得多...
-
我认为这可能会对您有所帮助stackoverflow.com/questions/799981/…
-
以及this。对此已有几个问题。
标签: javascript jquery