Answer the question
In order to leave comments, you need to log in
Why does onload fire only once after clearing the cache?
Hello, there is such a script waiting for the image to be loaded
let img = document.querySelector('.image');
img.onload = someFunc;
Answer the question
In order to leave comments, you need to log in
In short, I advise you to use jquery if compatibility is important, or you can do additional processing under ie, like this:
if (img.addEventListener) {
image.addEventListener('load', someFunc);
} else {
// для IE
img.attachEvent('onload', someFunc);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question