Hello, I have written some JS functions that use $.post(). At the moment, the app is hosted on a shared hosting, a pretty slow one. Before I call $.post() I have Loading(1)( a loading screen "powers up" ) and in the function that gets the response, my first instruction is Loading(0). From time to time, when I call a $.post()( when the server is working hard ), the Loading screen inits, but I don't get the response, it doesn't event enters function(response)(from $.post ) so the loading screen hangs there forever. I don't quite understand why is that happening, I would need some help with this.
It sounds like you need to add a fail clause to do some cleaning up when the script times out. .fail(function() { alert( "error" ); }) Code (markup): see https://api.jquery.com/jquery.post/#jqxhr-object
Thank you and sorry for not checking the docs first. I will test it and let you know if it doesn't solve the problem.