Created
February 7, 2012 10:05
-
-
Save sofish/1758905 to your computer and use it in GitHub Desktop.
image onload
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
| var img = new Image(); | |
| img.onload = function(){ | |
| alert('loaded, and u\'re a true image'); | |
| } | |
| // 这个将不会 alert 出来 | |
| // img.src="http://aliceui.com"; | |
| // 因为是真正的图片,onload 的时候会 alert 出来 | |
| img.src = "http://aliceui.com/wp-content/themes/aliceui/images/logo.png"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment