$.ajax({
url: SERVICEURL,
type: "GET",
headers: { "accept": "application/json;odata=verbose" },
async: false,
crossDomain: true,
success: function (data) {
var email = data.getElementsByTagName("person")[0].getElementsByTagName("email")[0]; //email is the field returned by the service
if (email != null && email != undefined)
document.getElementById('lblEmail').innerHTML = email[0].childNodes[0].nodeValue
},
error: function (xhr) {
console.log(xhr.status + ': ' + xhr.statusText);
}
});
url: SERVICEURL,
type: "GET",
headers: { "accept": "application/json;odata=verbose" },
async: false,
crossDomain: true,
success: function (data) {
var email = data.getElementsByTagName("person")[0].getElementsByTagName("email")[0]; //email is the field returned by the service
if (email != null && email != undefined)
document.getElementById('lblEmail').innerHTML = email[0].childNodes[0].nodeValue
},
error: function (xhr) {
console.log(xhr.status + ': ' + xhr.statusText);
}
});