Move jQuery to the end of body tag?

前端 未结 7 680
星月不相逢
星月不相逢 2020-12-05 16:06

My friend read an article which mentioned that moving all JavaScript files to the end of the closing body tag (), will improve the performance of a

相关标签:
7条回答
  • 2020-12-05 16:48

    It's standard practice to move all your js includes to the bottom of your page. This is because when a browser loads script, it does not spawn a new thread to do so, so basically the browser will wait until it has loaded the script before it proceeds to the next line.

    What this means for your users is that they will see a blank screen. Much better to have them see the full(ish) page as then it doesn't look like it has stalled.

    0 讨论(0)
提交回复
热议问题