REPLACE BROKEN IMAGES WITH A DEFAULT IMAGE
$('img').on('error', function (){
$(this).attr('src', '/path/to/image/default.png');
});
/*// OR hide
---------------------------*/
$('img').on('error', function(){
$(this).hide();
});
Also in JavaScript:
- jquery advace
- react redirect after login
- dart server listen how to recive json data
- js do every x seconds
- call javascript function from php
- javascript prevent context menu
- Process event is emitted right before Node Process crashes and exits:
- node sass version react
- toggle buttons angular styles
- array to string javascript
- react rating with fractions
- sorting array from highest to lowest javascript
- callout react
- regular expression not to allow space in javascript
- vs code how separate one line to multilines
- javascript create 2d array
- program to parenthesize an expression
- encodeuricomponent js
- javascript random color
- how to create tab component in jquery
- react js download file
- array js fill
- how to send get request to external server using node
- react-router react-router-dom