Created
May 18, 2015 21:48
-
-
Save ConradIrwin/009de9b4526f94f9435e 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
| <body> | |
| <script> | |
| iframe = document.createElement('iframe') | |
| iframe.setAttribute('sandbox', 'allow-same-origin'); | |
| blob = new Blob(['<body>'], {type: 'text/html'}) | |
| iframe.src = window.URL.createObjectURL(blob) | |
| iframe.addEventListener('load', function () { | |
| img = iframe.contentDocument.createElement('img') | |
| img.src = "https://lh3.ggpht.com/O0aW5qsyCkR2i7Bu-jUU1b5BWA_NygJ6ui4MgaAvL7gfqvVWqkOBscDaq4pn-vkwByUx=w300-rw" | |
| img.onload = function () { | |
| alert('image loaded'); | |
| }; | |
| iframe.contentDocument.body.appendChild(img) | |
| }, true) | |
| document.body.appendChild(iframe) | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment