Skip to content

Instantly share code, notes, and snippets.

@nathangathright
Created December 30, 2022 18:28
Show Gist options
  • Save nathangathright/683e44f4de91997917b019754a9bf8fc to your computer and use it in GitHub Desktop.
Save nathangathright/683e44f4de91997917b019754a9bf8fc to your computer and use it in GitHub Desktop.
<img src="http://SUBDOMAIN.DOMAIN.COM/hash/283379236/128" data-fallback="/feed/b9cd9278-2679-5cfd-9bc7-7f1e04f1cba4/item/f8e00bc8-9f47-11ec-adea-33b8a6094f44/128">
<script>
let podcastimages = document.querySelectorAll('[data-fallback]');
podcastimages.forEach(image => {
image.addEventListener("error", (event) => {
image.src!=image.dataset.fallback ? image.src=image.dataset.fallback : false;
})
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment