Last active
January 29, 2016 17:07
-
-
Save VandeurenGlenn/94891b96fc576ee99600 to your computer and use it in GitHub Desktop.
import dynamically
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 import(href, options) { | |
| var link = document.createElement('link'); | |
| var target = options.target ? options.target : document.head; | |
| if (options.async) { | |
| link.setAttribute('async', ''); | |
| } | |
| link.rel = 'import'; | |
| link.href = href; | |
| target.appendChild(link); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment