Created
October 15, 2017 03:42
-
-
Save sc0ttwad3/18cb49083536bf67ee772136cec37d03 to your computer and use it in GitHub Desktop.
Dynamic ES6 module loading fallback
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
<script type="text/javascript"> | |
var script= document.createElement('script'); | |
script.type= 'text/javascript'; | |
try { | |
Function('import("")'); | |
script.src= "app.js" | |
} catch(e) { | |
script.src= "fallback.js"; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment