Test failover immagini seta urb

This commit is contained in:
Leocraft1
2025-04-12 13:31:53 +00:00
parent 7312aa5db4
commit 827965a8bb
3 changed files with 20 additions and 2 deletions

8
scripts/images.js Normal file
View File

@@ -0,0 +1,8 @@
document.querySelectorAll('img').forEach(img => {
img.addEventListener('error', function () {
const fallback = this.getAttribute('data-fallback');
if (fallback && this.src !== fallback) {
this.src = fallback;
}
});
});