AsyncJS - Trick for better speed and compatibility
<head></head>
!
Never again will put your javascript in To gain speed when display content on the web page, you need to ideally place all the javascript code at the bottom of the page.
For various reasons (size, processing time, etc.), but today with AsyncJS will make everything more comfortable and will provide the necessary support(with only 1.22KB size! and Gziped 668byte!).
First off, call all load file functions[
window.async('file.js', ... )
] and after end it loop, load all anonymous functions[window.async(function(){...})
].
If the current protocol is
file://
and you input file has//
, AsyncJS change it tohttp://
API
Simple load script after load document
window;
Example
window;
Simple execute script after load document
window
Example
window;
Simple execute script with arguments after load document
window
Example
window;
Advance load script width callback after load document
window
Example
window;
Advance load script width success callback and arguments after load document
window
Example
window;
Advance load script width success callback, error callback and arguments after load document
window
Example
window;
Advance load script width success callback, error callback and arguments after load document
window
Example
window;
ONLINE DEMO
Click here to open online demo
SIMPLE DEMO #1
With this example you can put you own jQuery script and execute it only if jQuery file is loaded by AsyncJS(if it possible)
AsyncJS <!-- No need put jquery here!! :) -->
SIMPLE DEMO #2
With this example you can put you own jQuery script before load jQuery file
AsyncJS
ADVANCE DEMO
With this example you can put you own script before load another libraries
AsyncJS
Browser Support
- Google Chrome 4+
- Android & iOS
- Mozilla Firefox 2+
- Android & iOS
- Microsoft Internet Explorer 5.5+
- Microsoft Edge 0.10.10049+
- Desktop, Mobile & Server
- Android Browser 533.1+
- Since Android 2.2
- Safari 3.1+
- Windows & Mac OS
- iOS Safari 3.2+
- iPhone & iPad
[another deviced were not tested]
- iPhone & iPad
- Opera 9.5-9.6+
- Opera Mini 5.0+