javascript - How read of Object.keys() value JSON? -


how read of object.keys() value json ?

i trying read value key name, give error:

keys dynamic

             {              "marka1": {                  "name": "mika",                },              "beti1": {                  "name": "yii",                       }                } 

    var ojson = json.parse(objectjson);     var keys = object.keys(ojson); //read key     console.log("test  - " + ojson.keys[0].name); //give error 

change console.log("test - " + ojson[ keys[0] ].name); because keys[0] string.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -