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
- Host: GitHub
- URL: https://github.com/klich3/loadjs
- Owner: klich3
- License: mit
- Created: 2025-03-27T19:54:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-27T19:56:31.000Z (over 1 year ago)
- Last Synced: 2025-03-27T20:36:59.739Z (over 1 year ago)
- Topics: frontend, javascript, jquery, scripts
- Language: JavaScript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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');
}
}]
};
...
```