Created
May 3, 2018 15:32
-
-
Save wochap/38b8882068dcb2751363a79030e7e9f6 to your computer and use it in GitHub Desktop.
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
// getScript({ url, id }) { | |
// return new Promise(resolve => { | |
// const head = document.getElementsByTagName("head")[0]; | |
// const script = document.createElement("script"); | |
// let done = false; | |
// script.src = url; | |
// if (id) { | |
// script.id = id; | |
// } | |
// // attach handlers for all browsers | |
// script.onload = script.onreadystatechange = function () { | |
// if (!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) { | |
// done = true; | |
// if (typeof success === "function") { | |
// resolve(script); | |
// } | |
// } | |
// }; | |
// head.appendChild(script); | |
// }); | |
// }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment