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



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

yes, have normal ajax phone call calls imback.php, checks new stuff if have been blur 50 sec.

now if disconnects internet, , when on focus, not able imback.php.(i think 404 error) create offline msg/timeout thing, alerts "you have no net connection or else went wrong".

how can that?

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

you can utilize error callback this:

$.ajax({ url: 'imback.php', success: function(msg) { $('.newstuffsinceactive').prepend(msg); }, error: function(xhr, status, error) { alert("an error occured: " + error); } })

ajax jquery

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -