Fix broken images automatically

Occasionally we have times when we have broken image links on our website and replacing them one by one isn’t easy, so adding this simple piece of code can save you a lot of headaches.

$('img').error(function(){
     $(this).attr('src', ‘img/broken.png’);
});

 

Deja una respuesta

Tu dirección de correo electrónico no será publicada.

Rúa Pilar Miró n 6 Santiago de Compostela

Jersey St , Manchester, Greater Manchester M4 6JG, GB

T. 609 538 171 - 634 59 34 43

info@teslatechnologies.com