Put Scripts at the Bottom
Yslow recommends that you should put scripts at the bottom of the page.
Where exactly should I put them, after the body end tag?
My whole site runs in jquery, so all the javascript files are needed at the beginning. If I move them to the end, it might stop my site from working. That being the case, where instead should i put these scripts for best performance?
You should put them right before the closing body tag. Make sure your scripts are being initiated properly using
$(document).ready()
And you should have no issues.
你应该把它们放在结束体标签之前</body>
上一篇: 在</ html>标记之后放置javascript
下一篇: 将脚本放在底部