mtdtks
8/31/2016 - 2:40 PM

json on javascript. get key and value via "http://qiita.com/glaytomohiko/items/852ea64bcfc1e4fc1b51"

json on javascript. get key and value via "http://qiita.com/glaytomohiko/items/852ea64bcfc1e4fc1b51"

var jsonArray = { "key1":"value1", "key2":"value2", "key3":"value3" };

for(var key in jsonArray){
  alert("key=" + key + ", jsonArray=" + "[" + key + "]=" + jsonArray[key]) ;
}
/*
Alert is...

key=key1, jsonArray[key1]=value1
key=key2, jsonArray[key2]=value2
key=key3, jsonArray[key3]=value3
*/