开发者

jquery .getScript and resource tracking

开发者 https://www.devze.com 2023-03-26 00:24 出处:网络
rather than use something l开发者_Python百科ike yepnope.js is there a simple method/decent plugin that can check if a resource has previously been loaded in, if not load it?

rather than use something l开发者_Python百科ike yepnope.js is there a simple method/decent plugin that can check if a resource has previously been loaded in, if not load it?

I have a number of ajax calls and should I load the same form in more than once the eventlisteners are duplicated for each load (so 4th time form is loaded 4 handlers doing same thing are called). This is because it is a web service making remote calls so I use $.getScript() to include the js I need...

I've seen jquery resource loader but wondered if there was any other options.

Thanks.


You could try using another lib for script loading, like LABjs - it has option to prevent loading same script multiple times.

0

精彩评论

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