2011-05-27 25 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

相關問題