// 初始化数据
$('#select-type').html('加载数据中,请稍候...');
$.ajax({
url:basePath + 'servlet/back/xxS?type=cxCombo&lx=qblb',
type:'post',
timeout:1000*60*60,
data:{},
dataType:'json',
success:function(obj,textStatus){ //obj='{data:[{KHID:'',KHMC:'',XMLJ:'',ITAPSSLJ:'',CPKJ:'',SJKLJ:'',BKJ:'',ZXSJGC:'',LOCK:'',SYSX:'',SJ_GX:'',ITAPSS_GX:'',SJSJ:'',ZFBC:''}]}'
var data=obj.data;
$('#select-type').empty(); //清空select里面的所有内容
var html = '';
$.each(data, function(commentIndex, comment){
var str = "<option value="+comment['TEXT']+">"+comment['TEXT']+"</option>";
$("#select-type").append(str);
});
},
error:function(XMLHttpRequest, textStatus, errorThrown){
alert(errorThrown);
}
});
// 获取情报类别下拉框的数据
function getQBtype(){
return $("#select-type").val();
}
转载于:https://www.cnblogs.com/chai-blogs/p/5254409.html