Posted By

eliphas on 06/07/13


Tagged

#javascript #js #error #noimage


Versions (?)

Javascript No image


 / Published in: JavaScript
 

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

  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  

You need to login to post a comment.