I am new to jquery and would like to understand what is the difference between response and response.d, i am using response.d in failure alerts.
i wanted to know in case of failure what alert(respose.d) would display in message box.
below is my code
$.ajax({
type: "POST",
url:"Abc.aspx/Function1",
data: '{MonthDateID: ' + $('#<%=ddlMonth.ClientID%>').val() + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: Function2,
failure: function(response) {
alert(response.d);}});
Please do let me know in case of any query
response is the object always.
In order to to get your data you have to use response.d.
If you put only response in alert it will show you something like
[Object]in the alert.Suppose, response contains a message “Ajax call made successfully” then to see the message you have to use response.d (“d”) property of response.