Unobtrusive [removed] [removed] at the top or the

2019-01-02 17:42发布

I've recently read the Yahoo manifesto Best Practices for Speeding Up Your Web Site. They recommend to put the JavaScript inclusion at the bottom of the HTML code when we can.

But where exactly and when?

Should we put it before closing </html> or after ? And above all, when should we still put it in the <head> section?

7条回答
裙下三千臣
2楼-- · 2019-01-02 18:21

If you want to tinker with the position of your scripts, YSlow is a great tool for giving you a flavour if it's going to improve or hurt performance. Putting javascript in certain document positions can really kill page load times.

http://developer.yahoo.com/yslow/

查看更多
登录 后发表回答