Possible to defer loading of jQuery?

前端 未结 16 1131
孤街浪徒
孤街浪徒 2020-11-28 19:26

Let\'s face it, jQuery/jQuery-ui is a heavy download.

Google recommends deferred loading of JavaScript to speed up initial rendering. My page uses jQuery to set up s

16条回答
  •  隐瞒了意图╮
    2020-11-28 19:36

    Well it seems to me, all you have to do is either a) add the jQuery code you want to run on load, to the end of the jQuery file or b) append it to the downloadJSAtOnload function like so:

    
    

提交回复
热议问题