When do you choose to load your javascript at the bottom of the page instead of the top?

后端 未结 9 1207
渐次进展
渐次进展 2020-12-10 17:15

I have seen JavaScript libraries being loaded at the top and bottom of the page.

I would love to know when to make these choices. All the JavaScript code I\'ve writt

9条回答
  •  北海茫月
    2020-12-10 17:46

    I put all external scripts (such as Google analytics) at the bottom so their lag does not effect the loading of the DOM.

提交回复
热议问题