日期:2014-05-17 浏览次数:20448 次
$.ajax({
type: "post",
url: "frmNHreports.aspx/bindBuildInfo",
dataType: "json",
contentType: "application/json",
data: "",
dataType: 'json',
success: function(result) {
//alert(result.d);
var strJson = result.d;
var jsonObj = eval(strJson);
var selbuild = document.getElementById('drpInfor');
//alert(selbuild);
//清空下拉列表的值
selbuild.options.length = 0;
var html = '';
for (var i = 0; i < jsonObj.length; i++) {
html += '<option value="' + jsonObj[i].value + '">' + jsonObj[i].text + '</option>';
}
$(html).appendTo($("#drpInfor"));
},
error: function(result, status) { //如果没有上面的捕获出错会执行这里的回调函数
alert(result.responseText);
},
complete: function() {
}
});
//---------------------------------------------------------------