function loadScript(src) {
// creates a <script> tag and append it to the page
// this causes the script with given src to start loading and run when complete
let script = document.createElement('script');
script.src = src;
document.head.append(script);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function ( global ) { | |
'use strict'; | |
var Promise, PENDING = {}, FULFILLED = {}, REJECTED = {}; | |
if ( typeof global.Promise === 'function' ) { | |
Promise = global.Promise; | |
} else { | |
Promise = function ( callback ) { |