H
H
Happymalina2016-03-31 18:24:08
JavaScript
Happymalina, 2016-03-31 18:24:08

How to determine if an image has loaded using JQUERY?

There is a catalog on the site, some positions do not have pictures .. well, they are missing .. there is a way .. but there is no picture along this path. So this happened: ( alt for image fell out )
e919ae48b4054efb92b026954562763e.png

Googled a lot of all sorts of advice with .load, or .error, with jquery snippets. Most advise something like this:

$('img').error(function(){
alert('Problems loading image')
});

I thought about the src attribute, but I can’t check it for emptiness, since the path is indicated there, but it is not correct.

Tell me how to do it?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2016-03-31
@IceJOKER

write a small fixer.php script that will take all the data and use file_exists()it to check if the given file exists. if not, let it delete the path to the file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question