Javascript: what is the $result.rows.item(x) variable type?

I had a function that reads displays the contents of the SELECT query coming from WEBSQL of HTML5. I want to reuse that function but I have the problem since what am I getting is an Array of JSON object and I want to convert it it rows.item() so do anyone know how that works?

Example, I have this JSON Array


How can I convert it to like $result.rows.item()? item() is not an array right coz if it is an array it should be item[].


Using the idea and help of Jeff I figured out how to do it. See the live example


Ok, so assuming that the only difference between your array and the item() function is that one is an array and the other a function (I'm assuming that you use item() as "$result.rows.item(3)" to get the 4th row), is pretty simple. Just define a function which takes a parameter i and returns the item at index i in the array. So:

var myItemFunction = function(i) {
     return retdic[i]

Need Your Help

Php serialize and unserialize through form POST

php arrays serialization

I have set a number of hidden form inputs to have a value of a serialised array as shown in the example below: