I do a bunch of $.post()'s in my script, within a $(document).ready(function(){
jQuery says:
If a request with jQuery.post() returns an error code, it will fail silently unless the script has also called the global .ajaxError() method.
I tried adding this as a first test
$(document).ajaxError(function(e, xhr, settings, exception) {
alert('error in: ' + settings.url + ' \\n'+'error:\\n' + exception);
});
But it failed to do anything. Can anyone assist? I just need to popup an alert if the internet connection is lost. I also tried using window.navigator.onLine for this but it's not supported in Safari