我想用来自ajax的JSON编码数据填充表单输入。我的jQuery代码是
$('#event_id').blur(function(){
$.getJSON('../ajax/regattaformAjax.php', fetchOld);
function fetchOld(data){
$.each(data, function(label, value){
$('[#'+label+']',data).val(value);
});
}
});
来自regattaformAjax.php的JSON编码数据是
{"Address":"1717 88th Dr SE","Chevrons":"Black","City":"Lake Stevens","Class":"IOM","ClubAMYA#":"132"}
控制台中没有错误。我哪里误入歧途?