$(document).on('change','#citys_id',function () {
var id = $('#citys_id').val(); // 城市ID
var country_id = $('#quanpost-country_id').val();
var _this = $("#university_id");
$.ajax({
url: "/quan/post/university-id",
data: {
id: id,
country_id: country_id,
},
method: 'get',
success: function (data) {
_this.empty(); //清空上次的内容
_this.append(data) // 把返回来的所有大学名字,插入<select id='university_id'></selcet>中
},
error: function () {
alert("请求发生错误");
}
})
})
转载于:https://www.cnblogs.com/wangshuazi/p/9895056.html