Skip to content

Instantly share code, notes, and snippets.

@girvan
Created March 22, 2012 03:42
Show Gist options
  • Save girvan/2155473 to your computer and use it in GitHub Desktop.
Save girvan/2155473 to your computer and use it in GitHub Desktop.
<html>
<head>
</head>
<body>
<img src="http://pics.blog.yam.com/badimage.jpg" />
<script>
function hi(){
var i=new Image();
i.onerror=function(){alert('error and do something');};
i.src="http://pics.blog.yam.com/badimage.jpg";
}
</script>
<input type='button' value="test" onclick="hi();" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment