function loadScript(sPath, sFilename) {
		return new Promise(function (resolve, reject) {
			var script = document.createElement('script');
			script.async = true;
			script.src = sPath + sFilename;
			script.addEventListener('load', resolve);
			script.addEventListener('error', function () {
				return reject('Error loading script: ' + sFilename);
			});
			script.addEventListener('abort', function () {
				return reject(sFilename + ' Script loading aborted.');
			});
			document.head.appendChild(script);
		});
	}
function loadScript(sPath, sFilename) {
		return new Promise(function (resolve, reject) {
			var script = document.createElement('script');
			script.async = true;
			script.src = sPath + sFilename;
			script.addEventListener('load', resolve);
			script.addEventListener('error', function () {
				return reject('Error loading script: ' + sFilename);
			});
			script.addEventListener('abort', function () {
				return reject(sFilename + ' Script loading aborted.');
			});
			document.head.appendChild(script);
		});
	}
function loadScript ( sPath , sFilename ) { return new Promise ( function ( resolve , reject ) { var script = document . createElement ( 'script' ) ; script . async = true ; script . src = sPath + sFilename ; script . addEventListener ( 'load' , resolve ) ; script . addEventListener ( 'error' , function ( ) { return reject ( 'Error loading script: ' + sFilename ) ; } ) ; script . addEventListener ( 'abort' , function ( ) { return reject ( sFilename + ' Script loading aborted.' ) ; } ) ; document . head . appendChild ( script ) ; } ) ; }
Loads a <code>javascript</code> file.

@param {string} sPath The root path
@param {string} sFilename File to be loaded
@returns {Promise} A promise which resolves when the script is loaded
@private
Loads a <code > javascript< / code > file .
Load a script