jQuery Ajax Call, give offline/ "not able to connect" message -


Yes, I have a normal Ajax call that says imback.php, which checks for new stuff if you 50 sec

Now if you disconnect from the internet, and when you focus, then it will not be able to get the Imbaq.FP. (I think it's a 404 error) I would like to make an offline Msg / timeout thing, so it warns that "you have no internet connection or something went wrong".

How can I do this?

  $ .ajax ({url: 'imback.php', success: function (msg) {$ ('. NewStuffSinceActive'). Preeded ();}})  

You can use it for:

  $ Ajax ({url: 'imback.php', success: function (msg) {$ ('. NewStuffSinceActive'). Prepaid (msg);}, error: function (xhr, status, error) {warning ("An error occurred : "+ Error);}})  

Comments