Load jquery asynchronously before other scripts

后端 未结 5 1576
情书的邮戳
情书的邮戳 2020-12-05 06:33

I\'ve added the async attrib to my javascript inclusion HTML.
So now I\'ve:

         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 07:19

    This may be what you are looking for:
    http://www.yterium.net/jQl-an-asynchronous-jQuery-Loader - jQl an asynchronous jQuery Loader.

    It asynchronously loads jQuery without blocking other components:

    jQl.loadjQ('http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js');
    

    jQl automatically catches all jQuery().ready() calls, so you can write:

    
    

    jQl will queue these function calls, and execute them as soon as jQuery is loaded and the DOM is ready, as they would be executed in the usual way.

提交回复
热议问题