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