demand
Include file on demand
September 30, 2008 - 3:40pm — alexanmtzThis 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
