Last active
August 29, 2015 14:13
-
-
Save pier-oliviert/ae0320dce453b414309e 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
| var div = document.createElement('div') | |
| div.innerHTML = "<script></script>" | |
| var s = div.children[0] | |
| s.src = "//connect.facebook.net/en_US/all.js#xfbml=1" | |
| // true | |
| s instanceof HTMLScriptElement | |
| // Will NOT load the script | |
| document.head.appendChild(s) |
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
| var s = document.createElement('script') | |
| s.src = "//connect.facebook.net/en_US/all.js#xfbml=1" | |
| // true | |
| s instanceof HTMLScriptElement | |
| // Will load the script | |
| document.head.appendChild(s) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dah, just found this http://www.w3.org/TR/2008/WD-html5-20080610/dom.html#innerhtml0
That's why.