mirror of
https://github.com/driftywinds/driftywinds.github.io.git
synced 2025-12-19 11:03:32 +00:00
Handle missing/non-existent images
This commit is contained in:
@@ -35,6 +35,14 @@ function waitForAllImagesToLoad() {
|
||||
newImage.addEventListener("load", loaded);
|
||||
// Set src
|
||||
newImage.src = image.src;
|
||||
|
||||
// Unable to load image
|
||||
image.addEventListener("error", (event) => {
|
||||
if (event.target.id == "app-icon") {
|
||||
event.target.src = "img/generic_app.jpeg";
|
||||
} else event.target.remove()
|
||||
loaded();
|
||||
});
|
||||
});
|
||||
|
||||
function loaded() {
|
||||
|
||||
Reference in New Issue
Block a user