Techsavy
asked on
Ajax Help
Hi,
I am using following JQuery function to make an async call to SharePoint list data and return the count. However, when i run this function, I get data.d.results.length is not defined.
function GetActionLogItems(result) {
var violationCount = 0;
$.ajax({
url: "/_vti_bin/listdata.svc/Ac tionLog?$f ilter=((Pr opertyIDId %20eq%20" + result.Id + ")%20and%20(ActionTypeId%2 0eq%203))" ,
asynch: false,
success: function (data) {
violationCount = data.d.results.length;
}
});
return violationCount;
}
Please help, What i want from this function is the number of items returned from my Ajax call.
I am using following JQuery function to make an async call to SharePoint list data and return the count. However, when i run this function, I get data.d.results.length is not defined.
function GetActionLogItems(result) {
var violationCount = 0;
$.ajax({
url: "/_vti_bin/listdata.svc/Ac
asynch: false,
success: function (data) {
violationCount = data.d.results.length;
}
});
return violationCount;
}
Please help, What i want from this function is the number of items returned from my Ajax call.
can you tell us the value of 'data' by alerting the same?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.