You can't, it has to be a loop. Any particular reason you don't want a loop?

skelleex
—
2012-05-03T21:49:03Z —
#3

I know it has to be a loop but i am looking for a loop that can go through the JSON without knowing how much results are in the JSON object for instances if i want to do select all from my db i would like my loop to handle that query without modification

Paul_Wilkins
—
2012-05-04T00:03:48Z —
#4

skelleex said:

I know it has to be a loop but i am looking for a loop that can go through the JSON without knowing how much results are in the JSON object for instances if i want to do select all from my db i would like my loop to handle that query without modification

It's less expensive to send all of the required data at once, than to loop around multiple request/wait processes.

Send a request to your server letting your server know that you want to get all of the relevant data, and then handle that data when it's send to the client page.

skelleex
—
2012-05-04T00:35:32Z —
#5

paul_wilkins said:

It's less expensive to send all of the required data at once, than to loop around multiple request/wait processes.

Send a request to your server letting your server know that you want to get all of the relevant data, and then handle that data when it's send to the client page.

Hi paul,

rtndata has all the data within it within the for loop I just add html to each datarow, but I know the amount of rows of data I have. But what happens if I have more or less rows of data? I want a function that handles any number of rows of data. Like a while EOF or something to that extent.

Paul_Wilkins
—
2012-05-04T00:39:19Z —
#6

skelleex said:

Hi paul,

rtndata has all the data within it within the for loop I just add html to each datarow, but I know the amount of rows of data I have. But what happens if I have more or less rows of data?

You can use rtndata.length in the for loop instead, so that it loops over whatever number of items are in the array.