understanding jQuery $.getScript()

后端 未结 5 1561
情歌与酒
情歌与酒 2020-12-28 09:39

I use getScript to load dynamically my plugin:

$.getScript(\'js/code.photoswipe.jquery-3.0.4.min.js\', function () {
   //do magic
});
5条回答
  •  独厮守ぢ
    2020-12-28 10:24

    How to disable the cache busting:

    $.ajaxSetup({
      cache: true
    });
    

    That will ensure users grab the script from the server only once and from their local cache thereafter (unless their browser settings prevent caching).

提交回复
热议问题