Returning specific image instead of 404
We want to be able return a specific image that says "image not found" (rather than returning a 404 to the browser) when an IMG tag points to an non-existing file at our images library at /images/default-source/ for example. Is that possible to do through configuration, or customizing a provider?
Via Sitefinity, I doubt it. Via Javascript, you could do something like
<img src="xyz.gif" onError="this.onerror=null; this.src='notfound.gif';" />
or
$('img').error(function ()
$(this).unbind('error').attr('src', 'notfound.gif');
);
Hello Eric,
You can find various samples here: jQuery/Javascript to replace broken images
Hope this helps.
Regards,
Vassil Vassilev
Telerik
Excellent suggestions,didn't think about handling it in the client side. Thanks!