2
我試圖用這個結果集web服務,getYears
函數正在返回列表中的年份2013,2012,2011 ....在L ist<string>
但是當我把它與ddlyears
綁定值上來爲1,2,3,4,5,6jquery webservice foreach循環
$.ajax({
type: "POST",
url: "../WebService.asmx/getYears",
data:"{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
success: function (msg) {
for (var myVar in msg.d) {
$('#ddlyears').append("<option value='" + myVar.toString() + "'>" + myVar.toString() + "</option>");
}
},
error: function (jqerr) {
errorCaller(jqerr);
}
});
你需要告訴什麼'msg'是什麼? – xdazz 2013-04-09 10:22:18
聽起來像索引 – Andries 2013-04-09 10:27:12