Tom Rider
Tom Rider

Reputation: 2805

Detail error message in .error() jquery function

I am using .error() as the callback for .post(). Like :

 $.post("url", function(data){})
 .error(function(){
          alert("some error");
 });

I want to see the detailed error message if some error will occure. How can i see that ?

Upvotes: 0

Views: 74

Answers (1)

Naftali
Naftali

Reputation: 146302

 $.post("url", function(data){})
 .error(function(event, jqXHR, ajaxSettings, thrownError){
     console.log(event, jqXHR, ajaxSettings, thrownError);
 });

Upvotes: 3

Related Questions