Instead of showing a blank image, the best thing is to hide the img element itself from html page.
This can be done using following script:-
<script>
// Hide img tag
$("img").error(function(){ $(this).hide(); });
</script>
In case you want to show a blank image jpg, this can be achieved using following script:
<script>
// Replace missing image $('img').error(function(){ $(this).attr('src', 'missing.jpg'); });
</script>
This can be done using following script:-
<script>
// Hide img tag
$("img").error(function(){ $(this).hide(); });
</script>
In case you want to show a blank image jpg, this can be achieved using following script:
<script>
// Replace missing image $('img').error(function(){ $(this).attr('src', 'missing.jpg'); });
</script>
No comments:
Post a Comment