Why are my images not loading consistently on my HTML page?

I currently have a website that has a list of articles on the homepage that each has an image next to it. images from different sites. sometimes some images don't load when I check the url of those images and when I refresh the page it loads all of them.

Is there a way to ensure that they are loaded (even with js)?

The URLs are definitely fine, I suspect the sites the images are made from don't respond too well, but still when I try to work it myself.

0


a source to share


4 answers


Perhaps the sites you link to have image link protection mechanisms or such to reduce the load on their servers.



If you have permission to display these images on your site, upload them to your server.

+7


a source


I ran into this error before you change them with javascript or change the width of the parent div?



0


a source


If you are unable to host images yourself, try using an error event to try and reload corrupted images: www.quirksmode.org/dom/events/error.html

I've never used it myself, but this is how I tried to do it.

0


a source


Your web host might be in trouble. Shared hosting means that you are sharing this server with many other people and it can get overloaded in one minute, not overloaded the next. You might want to switch hosting companies, or ask your host to transfer you to a different server.

-1


a source







All Articles