Latest news
Home » jQuery » jQuery get($.get) or post( $.post) error catching

jQuery get($.get) or post( $.post) error catching

In jQuery generally using two methods for data posting. 
There is a chance of happening errors, for tracking get or post error use a jQuery fail() method.
If error occurred  will return to jQuery fail() method.

$.post("url",function(userdata){
alert(userdata)
);
}).fail(function(){
// error code here
alert('page not found')
});

Leave a Reply

x

Check Also

How to Check Expired Sessions using jQuery Ajax and PHP

We can achieve using the php and ajax.The following ajax call execute in every 10 ...