Hello, I write on Vanilla Js. The code returns a link to the image from the server, and then I put it as a background-image url. But how to do so, if the server returned 404 instead of an empty picture, put your own with an error?
Hello, I write on Vanilla Js. The code returns a link to the image from the server, and then I put it as a background-image url. But how to do so, if the server returned 404 instead of an empty picture, put your own with an error?
Source: https://ru.stackoverflow.com/questions/611988/
All Articles
background-image. If not loaded, then put another image with an error. But in general, your approach is fundamentally wrong. Content can not bebackground-imagein thebackground-image. And if you don’t have content there, but you shove design, then the only question is why you cannot guarantee the availability of a picture that is part of the design. - neluzhin