日期:2014-05-16 浏览次数:20548 次
$.ajax({
type: "post",
async: false,
contentType: "application/json; charset=utf-8",
data: "{id:'" + id + "'}",
url: "AllAssessResults.aspx/GetObjListByDeptId", //后台webservice里的方法名称
dataType: "json",
success: function (data) {
alert(data);
var optionstring = "";
var dataObj = $.parseJSON(data);
//var dataObj = eval("(" + data + ")");
for (var i = 0; i < dataObj.length; i++) {
optionstring += "<option value=\"" + dataObj[i].usercode + "\" >" + dataObj[i].username + "</option>";
}
$("#selectObj").html(optionstring);
},
error: function (msg) {
alert("出错了!");