Created
July 10, 2010 07:04
-
-
Save lifeinafolder/470529 to your computer and use it in GitHub Desktop.
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 img = new Image(); | |
img.onload = function(){ | |
//do something when the image loads | |
// for instance, inject in DOM. | |
var imgDom = document.createElement('IMG'); | |
imgDom.setAttribute('src','YOUR URL HERE'); | |
//some dom element reference - element | |
element.appendChild(imgDom); | |
} | |
img.src = 'YOUR URL HERE'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment