Hello! I have a json like:
{"156644":{ "name":"name1",
"street":"street1",
"city":"city1"
"68656":{ "name":"name2 ",
"street":"street2",
"city":"city1"
"388655":{ "name":"name3",
"street":"street3",
"city":"city1"
"4564":{ "name":"name4",
"street":"street4",
"city":"city1"
"6333":{ "name":"name5",
"street":"street5",
"city":"city1"}}
Now I want to decode this json. In my Javascript I wrote:
var object = eval(obj_json);
if(typeof(object)!="undefined"){
//fuel
for (var ii=0; ii<object.length; ii++){
alert(ii)
}
}
Now I get an Undefined error at object.length. So I tried to parse my json like:
var object = eval(' (' + obj_json + ') '); alert(object.length);
but this doesn't work at all. Now I get an "missing ] after element list" error.
Can U help me? PLZ!