0
JSON選擇框是充液從JSON
[["AF","Afghanistan"],["ZA","Afrique du Sud"],["AL","Albanie"]]
我怎麼就到了一個選擇框。我嘗試過,但沒有運氣。
$.getJSON('circuitCreation/countryList' + '?' + Math.round(new Date().getTime()),
{}, function(j){
var options = '';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].[0] + '">' + j[i].[1] + '</option>';
}
('#select_country').html(options);
});
非常感謝。我差點把頭撞在牆上。 – 2012-02-09 23:30:31