Assuming your JSON is like this
var item= { "items": [ { "FirstName":"John" , "LastName":"Doe" }, { "FirstName":"Anna" , "LastName":"Smith" }, { "FirstName":"Peter" , "LastName":"Jones" } ] }
You can request it like this:
$.each(item.items, function(index,item) { alert(item.FirstName+" "+item.LastName) });
Example: http://jsfiddle.net/4HxSr/9/
EDIT: According to JSON OP Added later
There are no elements in your JSON , so it is not valid.
Like your json like this
var item= { "COLUMNS": [ "username", "password" ], "DATA": [ [ "foo", "bar" ] ,[ "foo2", "bar2" ]] }
You should request it like this:
console.debug(item.COLUMNS[0]) console.debug(item.COLUMNS[1]) $.each(item.DATA, function(index,item) { console.debug(item[0]) console.debug(item[1]) });
Working example: http://jsfiddle.net/4HxSr/19/
Shyju
source share