Monday, 20 January 2020

How to control image shown error if the image not found on the location

I like to use this way, so that whenever original image is not available you can load your default image that may be your favorite smiley or image saying Sorry ! Not Available, But in case if both the images are missing you can use text to display. where you can also you smiley then. have a look almost covers every case.


<img src="path_to_original_img/img.png"  alt="Sorry! Image not available at this time" 
       onError="this.onerror=null;this.src='<?=base_url()?>assets1/img/default.jpg';">

No comments:

Post a Comment

redirect to new page from jquery

  function foo(id) { var url = ' @Url . Action ( "Details" , "Branch" , new { id = "__id__" })'...