개발/JavaScript

json.Parse

쵸코푸들이장군 2018. 2. 13. 15:20

여기서 result 는 json 형태의 string 이다.


 


 


result =>  [{"data_id":"2011","data_name":"Statement ","data_seq":13,"data_type":"S","parent_data_seq":"Indicator"},{"data_id":"2022","data_name":"aaaaa","data_seq":20,"data_type":"S","parent_data_seq":"Indicator"},{"data_id":"2013","data_name":"MC/DC Coverage","data_seq":17,"data_type":"S","parent_data_seq":"Indicator"}]


 


 


 


var jsonobj = JSON.parse(result);


 


for(var index = 0 ; index < listSize ; index++){


$J('#columnDataList').append($J("<option/>", { value: jsonobj.result[index].data_id , 


text: jsonobj.result[index].data_name }));


    }