EasyShop/Content/js/region.js
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
function InitProvince() {
if (xpregion) {
if ($("#area").length > 0) {
var provinceSelect = $('<select class=\"searchvalue\" id=\"province\" name=\"province\" onchange=\"InitCity(this.value)\"><option value="0">请选择</option></select>');
for (var n = 0; n < xpregion.length / 4; n++) {
$('<option value="' + xpregion[n * 4][1] + '">' + xpregion[n * 4][0].replace("->", "") + '</option>').appendTo(provinceSelect);
}//end for
$('#area').after(provinceSelect);
}
else {
document.write("<select class=\"searchvalue\" id=\"province\" name=\"province\" onchange=\"InitCity(this.value)\">");
document.write("<option value=\"0\">请选择</option>");
for (var n = 0; n < xpregion.length / 4; n++) {
document.write("<option value=\"" + xpregion[n * 4][1] + "\">" + xpregion[n * 4][0].replace("->", "") + "</option>");
}//end for
document.write("</select>");
}
}
}
function InitCity(pid) {
$('#city').remove();
$('#county').remove();
var citySelect = $('<select id="city" class=\"searchvalue\" name="city" onchange="InitCounty(this.value)"><option value="0">请选择</option></select>');
//citySelect.append('<option value="0">请选择</option>');
for (var i = 0; i < xpregion.length / 4; i++) {
var cd = xpregion[i * 4 + 1];
if (cd[0] == pid) {
for (var j = 1; j < cd.length; j++) {
if (cd[j][0] != "" && typeof cd[j][0] != "undefined") {
$('<option value="' + cd[j][1] + '">' + cd[j][0].replace("->", "") + "</option>").appendTo(citySelect);
}
}
}
}
$('#province').after(citySelect);
SetChoosedRegions();
}
function InitCounty(cid) {
$('#county').remove();
var countySelect = $('<select id="county" class=\"searchvalue\" name="county" onchange="InitStreet(this.value)"><option value="0">请选择</option></select>');
for (var i = 0; i < xpregion.length / 4; i++) {
var cd = xpregion[i * 4 + 2];
if (cd != "") {
var flag = false;
for (var j = 0; j < cd.length / 2; j++) {
if (cd[j * 2] == cid) {
flag = true;
if (cd[j * 2 + 1][0] != "" && cd[j * 2 + 1][0] != "undefined" && typeof (cd[j * 2 + 1][0]) != "undefined") {
$('<option value="' + cd[j * 2 + 1][1] + '">' + cd[j * 2 + 1][0].replace("->", "") + "</option>").appendTo(countySelect);
}
}
else {
continue;
}
}//end for
if (flag) break;
}//end if
}
$('#city').after(countySelect);
SetChoosedRegions();
后面还有 24 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。