Skip to content

Instantly share code, notes, and snippets.

@aheissenberger
Created September 15, 2019 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aheissenberger/88976c37f5549067b68d8ed6536a33fb to your computer and use it in GitHub Desktop.
Save aheissenberger/88976c37f5549067b68d8ed6536a33fb to your computer and use it in GitHub Desktop.
Insert Script Tag to load polyfill
<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