$(“#level”).click(function(){
$.ajax({
type:”POST”,
url:”{:U(‘Target/queryMajor’)}”,
dataType: “json”,
data:{
level:$(‘#level’).val()
},
success:function(data){
$(“#major”).empty();
switch (data.status){
case ‘1’:
$(“#major”).append(“<option value=” >–</option>”);
$.each(data.data,function(index,val){
$(“#major”).append(‘<option value=’+val.major+’ >’+val.major+'</option>’);
});
break;
case ‘0’:
$(“#major”).append(“<option value=” >–</option>”);
break;
}
return false;
}
});
return false;
});
$(“#level”).click(function(){
$.ajax({
type:”POST”,
url:”{:U(‘Target/queryMajor’)}”,
dataType: “json”,
data:{
level:$(‘#level’).val()
},
success:function(data){
$(“#major”).empty();
switch (data.status){
case ‘1’:
$(“#major”).append(“<option value=” >–</option>”);
$.each(data.data,function(index,val){
$(“#major”).append(‘<option value=’+val.major+’ >’+val.major+'</option>’);
});
break;
case ‘0’:
$(“#major”).append(“<option value=” >–</option>”);
break;
}
return false;
}
});
return false;
});
© 版权声明
文章版权归作者所有,未经允许请勿转载。