I have image attribute with src. I want to know when I delete image from server it should display image not exist in alt attribute. else it should display image. I am testing this with alert but dont know which keyword to use.
<head>
<script type="text/javascript">
$(function(){
alert($('img').attr('src'))
})
</script>
</head>
<body>
<img src="http://cdn1.iconfinder.com/data/icons/momenticons-gloss-basic/momenticons-gloss-basic/32/information2.png" />
</body>
If an
imgelement src returns a404(or any other http result other than200) it wil raise anerrorevent which you can trap.Try this: