Here is my json response:
[{"durum":"1"},{"durum":"2"},{"durum":"3"}]
My jquery function:
$("select#durum").change(function(){ $.post("autocomplete/ara_detay",{durum: $(this).val()}, function(j){ var events = j; var event = events[0]; alert(j.length); alert(j.durum); alert(j.durum); var options = ''; for (var i = 0; i < j.length; i++) { options += '<option value="' + j[i].durum + '">' + j[i].durum + '</option>'; } $("#durum").html(options); }) })
j.length alert says "43" and other alert messages says "undefined".
In which part am i doing wrong ?
j? and BTW, you can't useeventas a variable name.