usually, I'm using data from my own MySQL but my company decided to use third party API which produce this JSON data :
{"ongkir":{
"query":{"city":"444"},
"status":{"code":200,"description":"OK"},
"results":[{"subdistrict_id":"6131","province_id":"11","province":"Jawa Timur","city_id":"444","city":"Surabaya","type":"Kota","subdistrict_name":"Asemrowo"},...
and I have this jquery :
$.each(json, function(i,o){
subdistric += "<option value="+o.subdistrict_id+">"+o.subdistrict_name+"</option>";});
and it fails to display the <option> because the JSON data contains prefix which actually I don't need. how get subdistrict_id and subdistrict_name from "results" part of JSON using jquery?
thank you very much for your help
ongkiris common or change?