Created
February 22, 2019 03:01
-
-
Save xantiagoma/13943bb4ac5dcaf22c43bfe43e7c3efd 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
| function loadScript(url) { | |
| return new Promise(function(resolve, reject) { | |
| try { | |
| function callback() { | |
| resolve(); | |
| } | |
| var s = document.createElement("script"); | |
| s.src = url; | |
| if (s.addEventListener) { | |
| s.addEventListener("load", callback, false) | |
| } else if (s.readyState) { | |
| s.onreadystatechange = callback | |
| } | |
| document.body.appendChild(s); | |
| } catch (e) { | |
| reject(e); | |
| } | |
| }); | |
| } | |
| // await loadScript("https://cdn.jsdelivr.net/npm/[email protected]/tinycolor.js"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment