Question and answer is powered by AnsPress.io
I am using jquery ajax.I want to so server side exception in ajax.How can I log the exception?
Jquery ajax has an parameter name error.
$.ajax({
url:”add_url”,
data:{id:14},
type:’POST’,
success:function(){
},
error:function(error){
//Here you can get server side exception.
Console.log(error);
Console.log(error.responseText);
}
});
In the error method you can get the server side exception.