}
$('#Select1').append(ping);
}
})
$('#Select1').change(function () {
//第二次選時要記得清空市和縣中的內(nèi)容
$('#Select2 option:gt(0)').remove();
$('#Select3 option:gt(0)').remove();
//在省的改變事件里綁定下一個下來列表(要失掉省的id)
$.ajax({
type: "post",
contentType: "application/json",
url: "WebService1.asmx/loadcity",
data: "{fatherid:'" + $('#Select1 option:selected').val() + "'}",
success: function (result) {
var str2;
for (var i = 0; i result.d.length; i++) {
str2 += "option value=" + result.d[i].cityID + ">";
str2 += result.d[i].cityname;
str2 += "/option>";
}
$('#Select2').append(str2);
}
})
})
$('#Select2').change(function () {
$('#Select3 option:gt(0)').remove();
$.ajax({
type: "post",
contentType: "application/json",
url: "WebService1.asmx/loadarea",
data: "{fatherid:'" + $('#Select2 option:selected').val() + "'}",
success: function (result) {
var str3;
for (var i = 0; i result.d.length; i++) {
str3 += "option value=" + result.d.areaID + ">";
str3 += result.d[i].areaname;
str3 += result.d[i].father;
}
$('#Select3').append(str3);
}
})
})
})
/script>
/head>
body>
?。?BR> select id="Select1">
option>--請選擇--/option>
/select>
市:
select id="Select2">
option>--請選擇--/option>
/select>
縣:
select id="Select3">
option>--請選擇--/option>
/select>
/body>
/html>
webservice:
DAL--area
}
標(biāo)簽:岳陽 西藏 福州 衢州 湖州 宣城 西寧 紅河
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ajax.net +jquery 無刷新三級聯(lián)動的實例代碼》,本文關(guān)鍵詞 ajax.net,+jquery,無,刷新,三級,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。