when image is not found then automatically this function change image src by noimage.jpg which is default image.img src="any url" onerror="changeimage(this)" function changeimage(id) { id.src = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGhLzwUieFALJwbatbY8AsGwNKX2jG17_3f3ZTq1dwsGnx3-E0TLXpMaWriKxSXt2Q-JowqVyXAtYCXJ8H5elZJ4-P6eElixO1g8rOE10C3CqzSHufAQ5BbKKuCKjiqwvbiMEK-G7nJkBS/s1600/NoImage.jpg"; }
Tuesday, 23 April 2013
Change not found image by onerror event
We can change image Src when image is not found or image is not loaded by using onerror event of javascript.
For Example
Labels:
javascript
,
JQuery
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment