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