$.ajax({
url: "", //后台webservice里的方法名称
contentType: "application/json; charset=utf-8",
type: "get",
async : true ,
dataType: "json",
success: function (date) {
var optionstring = "";
for (var j = 0; j date.length;j++) {
optionstring += "option value=\"" + date[j].id + "\" >" +"睡眠次数:"+date[j].limitnumber+"nbsp;nbsp;睡眠时间:"+date[j].sleeptime + "/option>";
$("#select").html("option value='0'>请选择.../option> "+optionstring);
}
},
error: function (msg) {
alert("出错了!");
}
});