Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const brokenImages = () => {
- const placeholderPath = 'app/img/weholi-place-holder-image.png';
- const images = document.getElementsByTagName('img');
- for (let i = 0; i < images.length; i++) {
- const image = images[i];
- image.onerror = () => {
- image.src = placeholderPath;
- }
- }
- };
- document.addEventListener('DOMContentLoaded', brokenImages);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement