What is the most straightforward way to directly access or return the results of an array variable inside the .each(function) of a GetListItems completefunc without sending it to a CSS element in the document first?
The thought is to have only one SPServices call initially for a very short list which other client side code could loop through the array as needed.
Example (spservices 0.7.1a):
var arr = []; $().SPServices({ operation: 'GetListItems', listName: 'VeryShortList', CAMLQuery: '', CAMLViewFields: '', CAMLRowLimit: 0, completefunc: function getXML(xData, Status) { var k = 0; $(xData.responseXML).SPFilterNode('z:row').each(function() { var id = $(this).attr('ows_ID'), title = $(this).attr('ows_Title'); arr[k] = {id:id, title:title}; k = k + 1; // push the array here ....? }); // return resulting "arr" here ...? } });