Elementals.js

Latest Version: 2.0 RC 3 14 March 2017

Method _.scriptLoad

Summary:

Loads an external JavaScript file by appending a script Element to the document.body

Calling Convention:
_.scriptLoad(src[, attributes])
Parameters:
src
The URI of the script to load
attributes optional
An object of extra attributes to be set on the script tag. Most useful for setting data- parameters or async
Returns:
Nothing

Example

JavaScript

_.scriptLoad('test.js', { async : true });