开发者

What happens if you call jQuery $.getScript('myscript.js') twice?

I'm caching ajax:

$.ajaxSetup({
  cache: true
});
开发者_C百科

And I want to know, if I call a script that's already been loaded, will it load a second time or not?

$.getScript('js/jquery.colorbox-min.js');

Thanks!


The best way to answer that is simply look at the http requests through firebug, charles or fiddler2. However, jquery.colorbox.js should not misbehave even if it is loaded twice.


It does download it twice. You can see it in Firebug

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜