Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. function checkImage(imageSrc, good, bad) {
  2. var img = new Image();
  3. img.onload = good;
  4. img.onerror = bad;
  5. img.src = imageSrc;
  6. }
  7.  
  8. checkImage("foo.gif", function(){ alert("good"); }, function(){ alert("bad"); } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement