我的json回复:
char x = (char) ('a' + list.size() - 1);
我想在mySelect中用
显示json响应[{"id":"1","color":"red","id_t":"1"},{"id":"3","color":"black","id_t":"1"}]
提前致谢!
答案 0 :(得分:2)
在success
函数中尝试此操作: -
success: function( data ) {
$('#mySelect').empty();
$.each(data,function(i,d){
$('#mySelect').append($('<option/>', {
value: d.id,
text: d.color
}));
});
}