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
// this function will work cross-browser for loading scripts asynchronously | |
function loadScript(src) { | |
return new Promise(function(resolve, reject) { | |
const s = document.createElement('script'); | |
let r = false; | |
s.type = 'text/javascript'; | |
s.src = src; | |
s.async = true; | |
s.onerror = function(err) { | |
reject(err, s); |