<!DOCTYPE html>
<html>
<head>
<title>jQuery error() method</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("img").error(function(){
$("img").replaceWith("Error while loading an image.");
});
});
</script>
</head>
<body>
<p>Event error when not image not loading correctly</p><br /><br />
<img src="../../images/img_nat.pngc" width="207" height="137" />
</body>
</html>