Include file on demand
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 releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 1.1.1-rc-1 | 2009-Mar-14 | 5.81 KB | Recommended for 1.2.x | ||
| 2.1-rc-2 | 2009-Apr-16 | 5.81 KB | Recommended for 1.3.x | ||
