JQuery Ajax data.d


$.ajax({
url: 'EmailExist.action',
data: '{email:"' + email + '"}',
type: 'post',
dataType: 'json',
contentType: 'application/json; charset=utf8',
cache: false,
success: function(data) {
if (data.d) {
setTimeout(function() {
//$('#ctl00_holderLeft_txt_email').val('');
$('#tip_email').removeClass('validation-valid');
$('#tip_email').addClass('validation-error');
$('#tip_email').html('E-mail: <strong> "'+ email +'</strong>" already exists, please use other mailbox');
}, 10);
}
//else
//$('#tip_email').html("Mailbox input success");
},
error: function(xhr) {
$('#tip_email').html(xhr.responseText);
}
});


There is a data.d Ajax, please tell me what the data.d is what meaning?

Started by Evan at December 05, 2016 - 11:27 AM

A perfect explanation of the meaning of data.d

Posted by Burgess at December 09, 2016 - 11:54 AM

This D is to look at your Ajax to access the URL response in D will have no
For example, AJAX returns {'d':1,'msg':'exists'}
The value of data.d is 1
Paste this code is mainly to determine whether the mailbox already exists
Return {'d':1}

Posted by Buck at December 19, 2016 - 12:13 PM

D is the attribute asp.net WebService returned JSON object (including your return content returned), other contents are stored in the D property.

Posted by Juliana at December 31, 2016 - 1:00 PM