Created
August 25, 2017 18:31
-
-
Save nolanlawson/2adfc509329945684dc22614f767ce8d to your computer and use it in GitHub Desktop.
iframe blob uri 2
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
<!doctype html> | |
<html lang="en"> | |
<body> | |
<script> | |
(function () { | |
var theIframe = document.createElement('iframe') | |
theIframe.sandbox = '' | |
var html = '<html><h1>hello world!</h1></html>' | |
var blob = new Blob([html], {type: 'text/html'}) | |
var url = URL.createObjectURL(blob) | |
theIframe.src = url | |
document.body.appendChild(theIframe) | |
})() | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment