I’ve made a website with photos on it that get refreshed every second. I fetch these photos from a web server with a jQuery $.ajax() call every second. This creates some sort of infinite photo-loading loop, which I want.
However, my page just keeps on loading (the spinning icon keeps spinning or loading bar is loading forever). Especially on Chrome this is annoying, because there’s a spinner next to my mouse.
How can I prevent that it doesn’t look like my page is loading forever, without changing functionality? Thanks..
You shouldn’t be hitting your server every second like that. Because while it may work for a single person, once you go live and more people visit your site, it may kill your server.
Warning aside, you might try waiting till the page is fully loaded before firing off your ajax. You could use
setTimeoutto wait a few seconds. However, here I think you may be getting the loading notification because the images are being fetched from the server.