2011-05-27 38 views
3

我依稀记得有人想出解决这个问题,但我可以'为我的生活记住图书馆的名字。基本思路是,通过在页面顶部加载一个单独的小型库,您可以获得渲染速度优势,即可以在页面底部加载其他脚本,同时能够排列要在DOM就绪状态下运行的函数。谢谢

回答

3

您是否想到Head JS

您已阅读书籍并将SCRIPT SRC标签放在底部。好。但你能做到吗?

// use jQuery on the body of the page even though it is not included yet 
head.ready(function() { 
    $("#my").jquery_plugin(); 
}); 

// load jQuery whenever you wish bottom of the page 
head.js("/path/to/jquery.js"); 
+0

是的,谢谢! – treeface 2011-05-28 00:39:41

相关问题