javascript - Accessing JSON data that has no labels -
var listcompleteinjections = [ {"05-06-2014",0.5}, {"16-06-2014",0.5}, {"20-06-2014",0.5} ];
this fragment of data receiving device. has key , value no labels denote same. unable access keys , values due absence of labels. please help.
p.s. data corresponds "date" , "dosage".
given json invalid.
check this jsonlint or jsonviewer
given string not json can not read data.
if have unknown key->value pair can access json:
var p = { "p1": "value1", "p2": "value2", "p3": "value3" }; (var key in p) { if (p.hasownproperty(key)) { alert(key + " -> " + p[key]); } }
Comments
Post a Comment