Arkadaşlar merhabalar,
Bir select'im var, ülke isimlerini basmak istiyorum. Verileri json'dan almaya çalışıyorum.
Böyle bir fonksiyon çalıştırıyorum.
<div class="select" onchange="model.country = this.value"> <select id="country"> </select> </div>
Buradaki Div içerisindeki select'e basmaya çalışıyorum ama olmuyor, yardımcı olur musunuz lütfen?
function(){
var countryOptions;
$.getJSON('countries.json',function(result){
$.each(result, function(i,country) {
//<option value='countrycode'>contryname</option>
countryOptions+="<option value='"
+country.code+
"'>"
+country.name+
"</option>";
});
$('#country').html(countryOptions);
});