Created
August 24, 2012 20:18
-
-
Save Lendar/3455208 to your computer and use it in GitHub Desktop.
patching HTML page with something else
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
var alien = document.createElement('html'); | |
alien.innerHTML = '<html><head><title>The Page</title></head><body><h1>hi!</h1></body></html>'; | |
document.head.innerHTML = alien.getElementsByTagName('head')[0].innerHTML; | |
document.body.innerHTML = alien.getElementsByTagName('body')[0].innerHTML; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment