An open API service indexing awesome lists of open source software.

https://github.com/klich3/loadjs

A simple function for asynchronously loading JavaScript files with possibility of callback function
https://github.com/klich3/loadjs

frontend javascript jquery scripts

Last synced: 3 months ago
JSON representation

A simple function for asynchronously loading JavaScript files with possibility of callback function

Awesome Lists containing this project

README

          

loadJS
======

A simple function for asynchronously loading JavaScript files with possibility of callback function

## Usage

Place the [`loadJS` function] inline in the `head` of your page (it can also be included in an external JavaScript file if preferable).

Then call it by passing it a JavaScript URL:

``` html

...

var jsToLoad = {
path:'js/', //path to js folder
items:[
{
file:'jquery-1.11.1.js' //file to load
}, {
file:'jquery.uilang.js',
callback:function(){
//callback function
console.log('callback');
}
}]
};

...

```