I am using json data received from server to display images. I am getting all images path and making them a string “html” and at last using $("#result").html(html); to append all html to a div result.
My problem is that there are some image paths but corresponding to these paths there is no image and I want to display an error message in this case.
I can use
$('img').error(function(){
console.log('error');
});
but the problem is I want to add error message with each image which is not present. Unable to do it because I am displaying all images collectively at the end using $("#result").html(html)
Please solve my problem.
Thanks
Romi
try this one.
hope you can see now where the problem is :), if still not let me know.