嗨朋友我正在尝试将我的 ajax 输出附加到我的下拉列表中......
我的ajax函数:-
$.ajax({
url: "getcolumn",
data: {value: value},
type: "POST",
success: function(output) {
var column = output;//here i am assigning the output to another variable
var mySelect = $('#table_name');
$.each(column, function(val, text) {
mySelect.append($('<option></option>').val(val).html(text));
});
我的下拉列表:-
echo $this->Form->input('Column', array(
'label' => 'Select the column name below',
'name' => 'tablename',
'id' => 'table_name',
'options' => array('null')
));
我想将 ajax 的输出附加到上面的下拉框......我试图在我的 ajax 成功函数中附加,但没有工作。谁能帮帮我....输出是json的形式.....