|
Project Information
Featured
Downloads
Links
|
Source can be found at https://github.com/NJLaPrell/pluginloader The Plugin Loader is a light weight function in the jQuery namespace for loading and tracking jQuery plugins, JavaScripts, and required CSS. Scripts can be loaded serially or asynchronously. Plugin Loader can be used to force dependencies by loading required scripts and CSS in each plugin. Because the scripts and CSS are tracked, nothing will be loaded more than once. March 22, 2012I regret to announce that I will no longer be contributing to the Plugin Loader project. My company was acquired late last year and in the integration process, it was decided that I will not be permitted to continue pursuing projects like this on my own time. I am permitted to continue my projects in an official capacity as an employee, however, the terms are not desirable. I will leave the source on Github, but will be making no further contributions. If you have found this project useful, I strongly encourage you to fork it and continue its development. November 5, 2011Version 2.0.02 has been released to address a minor bug that was causing ".js" to be appended to libs and scripts. August 11, 2011I have officially released version 2 (2.0.01) with a few bug fixes. I have also updated it to take a string or array list of plugins as the argument (which causes it to use all default settings) or the parameter list. This should make it a bit more backwards compatible with calls that used the previous versions. August 9, 2011I have posted a very early release of version 2.0. All of the new features are in, but only minimal testing has been performed at this time. Please Note: Version 2 now takes a single argument with all parameters, so the way it is called is different. Installation (Version 2)
Now, simply load up the script to get started: <script type="text/javascript" src="/jquery.pluginLoader.js"></script> Usage (Version 2)Usage is simple. The $.loadPlugins() function takes the following parameters: list - String for a single plugin or an array for multiple. path - (optional) The path where the called component(s) is/are stored. cache - (optional) Set to true to prevent the browser from caching the file. async - (optional) Set to true to call the files asynchronously or false to call them serially (use caution,this can cause the browser to freeze in some environments). Load jQuery plugins "foo" and "bar." $.loadPlugins({list:['foo','bar']});Lets say foo has a corresponding CSS file. Update the foo plugin to call: $.loadCSS({list:'foo'});There is a small utility library called bob you need to load from the /libs/js/ folder: $.loadLib({list:['bob.js'],path:'/libs/js/'});July 18, 2010The latest update now tracks which plugins are loaded automatically, without the need to add variables to each individual plugin script. Each plugin in the jqPlugins object is assigned a value of true if it loaded successfully, false if it did not, or undefined if the Plugin Loader never attempted to load it. Installation
Now, simply load up the script to get started: <script type="text/javascript" src="/jquery.pluginLoader.js"></script> UsageUsage is simple. The $.loadPlugins() function takes either a string (one plugin at a time) or an array, as well as an optional object to define additional options. We would load up jquery.foo.js and jquery.bar.js like this: $.loadPlugins(['foo','bar']); OptionsAn object with the following options can be passed as the second parameter:
Tips
|