Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathankingston/defer-js-load-jquery
A plugin for jQuery to allow you to lazy load other javaScript scripts and add handlers to notice when they have loaded
https://github.com/jonathankingston/defer-js-load-jquery
Last synced: about 2 months ago
JSON representation
A plugin for jQuery to allow you to lazy load other javaScript scripts and add handlers to notice when they have loaded
- Host: GitHub
- URL: https://github.com/jonathankingston/defer-js-load-jquery
- Owner: jonathanKingston
- Created: 2012-02-03T12:26:25.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-02-03T14:35:51.000Z (almost 13 years ago)
- Last Synced: 2024-04-17T02:07:33.134Z (9 months ago)
- Homepage:
- Size: 85.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
This script allows you to leave loading of scripts till after the page has rendered.
To use this include the script in your header after jQuery.
Then to load a script deferred use the following:$().deferJSLoad('url.js');
To check the js has loaded and to bind further events use code like this:
function jsTest() {
//example of lazyloaded fancybox plugin, this binds the fancybox element after it has loaded
$('a.popup').fancybox();
}$(window).bind('deferJSLoaded', jsTest);