javascript - list only all keys including nested from json object in jquery -
i want list keys(including nested) in json object in jquery... keys/ json object dynamic program never format json sure
i need jquery list keys json
following sample data:
{ "status_code": 200, "status_text": "success", "count": 6, "data": [{ "date": "2012-02-27", "zone": "north zone", "centre": "chandigarh", "commodity": "tea loose", "price": "265" }, { "date": "2012-02-24", "zone": "north zone", "centre": "chandigarh", "commodity": "tea loose", "price": "265" }] }
from above json want list keys.
var jsonarray={ "status_code": 200, "status_text": "success", "count": 6, "data": [ { "date": "2012-02-27", "zone": "north zone", "centre": "chandigarh", "commodity": "tea loose", "price": "265" }, { "date": "2012-02-24", "zone": "north zone", "centre": "chandigarh", "commodity": "tea loose", "price": "265" } ] } var l = jsonarray.length; (var = 0; < l; i++) { var obj = jsonarray[i]; (var j in obj) { alert(j); } }
try works .
Comments
Post a Comment