I have a list and when the page loads I want to grab the items from my list and add it to an array. I am getting an error when I try to read the rest data. Here's what i have so far.
<script>$(document).ready(function() { var iceCreamApp = {}; iceCreamApp.Truck = new Array(); //Load data from list into array right away (function() { var url = "http://isaac.issharepoint.com/demo/_vti_bin/listdata.svc/IceCreamTrucks"; $.ajax({ url:url, method:"GET", headers: {"Accept": "application/json; odata=verbose"}, success: function(data) { success(data.d); }, error: function(data) { failure(data.responseJSON.error); } }) function success(data) { console.log(data.d.results); } }());})</script>
You call Success like this;
success(data.d);
But the signature is this;
function success(data)
So you're effectively calling console.log(data.d.d.resul