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
精彩评论