How To Find The Exact Error When Using $.ajax In JQuery?

Jquery_logo


We can find the exact error while using ajax() method of JQuery with the help of responseText property of the request parameter.

Here is the code.


$.ajax({
type: "post",
data: { id : 0 },
url: "getProfileDetails" ,
dataType: "html",
success: function (html)
{
alert (html);
}
error: function(XMLHttpRequest, textStatus, errorThrown)
{
alert(XMLHttpRequest.responseText);
}
});


References:-
http://api.jquery.com/jQuery.ajax/
Share on Google Plus

About JK STACK

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment