I have a function that reads and displays the contents of a SELECT query from WEBSQL in HTML5. I need to reuse this function, but I am facing an issue because it returns an Array of JSON objects and I want to convert it to rows.item(). Does anyone know how to achieve this?
For example, consider this JSON Array:
"retdic":[{"row_index":0,"lname":"Mato","age":26,"gender":"M","pic":"cyborg.jpg","fname":"Shibiru"},
{"row_index":1,"lname":"Taro","age":30,"gender":"M","pic":"folder_wrench.png","fname":"Ichigo"},
{"row_index":2,"lname":"Joni","age":27,"gender":"M","pic":"naruto.jpg","fname":"Perez"},
{"row_index":3,"lname":"Sakura","age":24,"gender":"F","pic":"folder_table.png","fname":"Haruka"},
{"row_index":4,"lname":"Naruto","age":20,"gender":"M","pic":"naruto.jpg","fname":"Uzumaki"}]
Is there a way to convert it to something like $result.rows.item()? Since item() is not an array (as it should be item[] if it were), how can this conversion be done?
UPDATE
With Jeff's assistance and ideas, I was able to find a solution. Check out the live example