开发者

Put Scripts at the Bottom

开发者 https://www.devze.com 2023-02-09 06:56 出处:网络
Yslow recommends that you should put scripts at the bottom of the page. Where exactly should I put them, after the body end tag?

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 perfo开发者_高级运维rmance?


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.


you should put them just before the ending body tag </body>

0

精彩评论

暂无评论...
验证码 换一张
取 消