Move jQuery to the end of body tag?

前端 未结 7 710
星月不相逢
星月不相逢 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:25

    The $(document).ready function says not to run until the DOM has finished being instantiated - so moving it to after body is okay so long as the JQuery library is loaded first. Unconventional and some assumptions may not be correct anymore but okay.

提交回复
热议问题