Created
September 15, 2019 14:32
-
-
Save aheissenberger/88976c37f5549067b68d8ed6536a33fb to your computer and use it in GitHub Desktop.
Insert Script Tag to load polyfill
This file contains 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> | |
if (featureText()) { | |
document.currentScript.insertAdjacentHTML( | |
"afterend",` | |
<script src="/polyfill.js" ><\/script> | |
`); // closing tag needs to use an escaped backslash | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment