<script>
$(function () {
ShowSheng();
})
$(function () {
ShowSheng();
})
function ShowSheng() {
$.ajax({
url: "/Home/Sheng",
type: "get",
dataType: "json",
success: function (da) {
$(da).each(function (index, item) {
$("#S1").append("<option value='" + item.Aid + "'>" + item.Aname + "</option>");
})
}
})
}
$.ajax({
url: "/Home/Sheng",
type: "get",
dataType: "json",
success: function (da) {
$(da).each(function (index, item) {
$("#S1").append("<option value='" + item.Aid + "'>" + item.Aname + "</option>");
})
}
})
}
function SelQu(t) {
var m = $(t).val();
$.ajax({
url: "/Home/Shi",
type: "get",
data: { id: m },
dataType: "json",
success: function (da) {
$("#S2").empty();
$(da).each(function (index, item) {
$("#S2").append("<option value='" + item.Aid + "'>" + item.Aname + "</option>");
})
}
})
}
</script>
var m = $(t).val();
$.ajax({
url: "/Home/Shi",
type: "get",
data: { id: m },
dataType: "json",
success: function (da) {
$("#S2").empty();
$(da).each(function (index, item) {
$("#S2").append("<option value='" + item.Aid + "'>" + item.Aname + "</option>");
})
}
})
}
</script>
<div>
省市:<select id="S1" onchange="SelQu(this)"><option value="0">---请选择省市---</option></select>区镇:<select id="S2"><option value="0">---请选择区镇---</option></select>
</div>