Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

Include file on demand


Average rating
(3 votes)

This tool include files(Javascript and / or CSS) in the head of the document and load. You can pass a single file or a array of files (can be mix of CSS or Javascript). You can passa a callback to execute some code after the script has loaded.

This plugin is useful for load scripts on demand or insert components for ajax calls.

The plugin checks if the file already exist before add and the callback for Style files wasn´t fully tested because of tricks of browsers*

Usage

Single javascript file

$.include('file.js');

Array of files

$.include(['file.js','file02.js']);

Even a mix of file

$.include(['script.js','style.css']);

You can specify the base path to be used in all calls of the plugin

$.includeBasePath = 'path/to/include';

You can have a callback to execute code when script has loaded

$.include('file.js',function(){
//some code
});

* The internet explorer has a ready state property to verify if the element was loaded, the firefox doesn´t have this feature, so a different method to certify the file loaded was used

Releases

Official releasesDateSizeLinksStatus
1.1.1-rc-12009-Mar-145.81 KBRecommended for 1.2.xThis is currently the recommended release for 1.2.x.
2.1-rc-22009-Apr-165.81 KBRecommended for 1.3.xThis is currently the recommended release for 1.3.x.