Javascript No image


/ Published in: JavaScript
Save to your folder(s)

script that allow you to replace an image if that one doesn't exist


Copy this code and paste it in your HTML
  1. <img src="myimagenotfind" onError="remove_el(this);" >
  2.  
  3. function remove_el(image) {
  4. image.onerror = "";
  5. image.src = "/images/noimage.gif";
  6. return true;
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.