I've been exploring several options to load various jQuery plugins
only when needed, from within a javascript file.  I've used
the .getScript() method, with callbacks.  I've used the $
("body").append("<script....>") method also.  They work fine, but with
one shortcoming.  Because both of these methods append a jQuery id
number to the script's file name, the scripts are reloaded every time
the page is called.  It doesn't allow the browser to reuse the scripts
that have already been downloaded into the cache.

Are there any other alternatives?  I have a separate .js file for each
web page, and in that .js file I only want to load the additional
jQuery plugins I need for that particular page.

Thanks,
Carl

Reply via email to