Occasionally when a remote server my app contacts is slow, I get the following error message “The connection to the server was unsuccessful. (file///android_asset/www/xx.html)” . I believe the IOS version just freezes up in this circumstance.
I have it pretty much narrowed down to my ajax $.get request timing out because the remote server is slow or down. I read that $.get is basically shorthand for $.ajax so I added a global ajaxtimeout statement $.ajaxSetup({ timeout: 0 }); to hopefully stop that error. At least I hope the $.ajaxSetup will also work for $.get. Sorry if my technobabble isn’t correct as this is somewhat new to me.
So, I’m not sure that the ajaxSetup fixed the problem since the remote server’s slowness is random. Is there any other way to monitor / trap the above error message within MobiOne to give the users a better error message and programatically react?
Thanks,
Jim