Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkImage(imageSrc, good, bad) {
- var img = new Image();
- img.onload = good;
- img.onerror = bad;
- img.src = imageSrc;
- }
- checkImage("foo.gif", function(){ alert("good"); }, function(){ alert("bad"); } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement