2021.7.28的博客

二级联动

function Loadselone() {
$.get('http://localhost:9798/api/Values/GetCity/0', res => {
$(res).each(function () {
$("#Cityone").append('<option value="' + this.cId + '">' + this.cName + '</option>');
})
})
}

function Loadseltoo() {
var id = $("#Cityone").val();
$("#Citytoo").empty();
$.get('http://localhost:9798/api/Values/GetCity/' + id, res => {
$(res).each(function () {
$("#Citytoo").append('<option value="' + this.cId + '">' + this.cName + '</option>');
})
})
}

Ajax

创建一个表字段要创建一个类型字段进行区分。

posted @ 2021-07-28 21:31  猫什  阅读(48)  评论(0)    收藏  举报