I will try my best to explain what I am trying to accomplish. I have data being returned from my call and on my each function it is in a variable that is getting data from 2 rows of the first 2 items from a list of 30. How do I traverse to the next 2 items in the list. Do I use push?
$.ajax({
type: 'GET',
headers: {
'accept': 'application/json;odata=verbose'
},
url: "/website/_api/web/lists/getbytitle('myList')/items",
success: function(data) {
var newRows = "";
$(data.d.results).each(function (index, items) {
// alert(newRows);
if(index < 2 )
newRows += "<tr><td>" + data.d.results[index].Market +
"</td><td>" + data.d.results[index].State + "</td></tr>";
else
return false;
});