//ajax+select三种常用交互方式
window.οnlοad=function(){
test();
}functiontest(){
alert("执行");varstart= 0;varsize=100;varheadNo= "111111";
$.ajax({
type :"post",
url :"/ssm_pms/admin_group/list",//此次url改为真正需要的url
data : {"headNo":headNo,"start":start,"size":size
},
dataType :'json',
success :function(data) {
loadData(data.hotelChainList);
},error:function(){
alert("error");
}
});varloadData=function(list){for(vari= 0; i
$("#hotelNo").append(""+list[i].hotels[0].hotelName+"")
}
}/*$.ajax({
type : "post",
url : "/ssm_pms/admin_group/list", //此次url改为真正需要的url
data : {"headNo":headNo,
"start":start,
"size":size
},
dataType : 'json',
success : function(data) {
$.each(data.hotelChainList, function(index, item) {
$("#hotelNo").append( //此处向select中循环绑定数据
"" + item.hotels[0].hotelName+ "");
});
},
});*/
/*$.ajax({
type : "post",
url :"/ssm_pms/admin_group/list", //此次url改为真正需要的url
data : {"headNo":headNo,
"start":start,
"size":size
},
dataType : 'json',
success : function(data) {
alert(data.returnMsg);
var list = data.hotelChainList;
for (var i = 0; i < list.length; i++) {
alert(list[i].hotels[0].hotelNo)
$("#hotelNo").append(""+list[i].hotels[0].hotelName+"")
}
},error:function(){
alert("error");
}
});*/}
请选择酒店