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
Post a Comment