2016年中国省市区三级联动JSON格式
中国省市区三级联动表
在“省” 列单元格 选中后, 依次选 择,数据 →数据验 证→数据 有效性 (弹出数 据有效性 选择框) 设置→允 许(下拉 列表)→ 序列→在 来源框中 填入 =INDIREC T(a57), 其中括号 内的a57 为国家所 在列的单 元格号
“市”“ 区”列单 元格也做 同样的操 作,仅在 =INDIREC T(这 里),括 号中所对 应的相应 的单元 格,市列 选择省列 单元格, 区列选择 市列单元 格 自此设置 完毕,效 果如下, 如果觉得 国家列不 美观,可 以把国家 列隐藏起 来即可
以上示例 图片为效 果展示图 。为使用 方便。介 绍一个 excel的 函数命令 如下: "=INDIRE CT(I4)" 将文本中 的省, 市,区工 作簿复制 到要实现 省市区三 级联动的 表内 然后就是 实现步 骤,为了 方便学 习,我们 将b列设 为省,c 列设为 市,d列 设为区
为了简化 记忆本次 三级联动 只用了一 个命令就 是上面的 =INDIREC T(I4) 我们将a 列设为国 家,内容 全部填写 中国,这 样方便我 们使用 =INDIREC T(I4)命 令 本表中含 有很多定 义好的名 称,所以 使用时可 以在本表 中建立新 的工作 簿,复制 copy都是 无效的
国家 中国 中国 中国 中国 中国
省 上海 河北
三级联动,json数据、可设置默认城市
三级联动,json数据、可设置默认城市闲来⽆事,折腾个三级联动,json数据、可设置默认城市、可配置是否显⽰第三级select<!DOCTYPE html><html><head><meta charset="UTF-8"><title>省市县三级联动</title><script src="/jquery/1.9.0/jquery.js"></script><script type="text/javascript">var cityjson = '{'+ '"province" : ['+ '{"id" : "1", "name" : "北京市"},'+ '{"id" : "2", "name" : "⼭西省"},'+ '{"id" : "3", "name" : "河北省"}'+ '],'+ '"city" : ['+ '{"cid" : "1", "id" : "1", "name":"海淀区"},'+ '{"cid" : "1", "id" : "2", "name":"西城区"},'+ '{"cid" : "1", "id" : "2", "name":"东城区"},'+ '{"cid" : "1", "id" : "3", "name":"朝阳区"},'+ '{"cid" : "2", "id" : "4", "name":"太原市"},'+ '{"cid" : "2", "id" : "5", "name":"⼤同市"},'+ '{"cid" : "2", "id" : "6", "name":"阳泉市"},'+ '{"cid" : "3", "id" : "7", "name":"⽯家庄"},'+ '{"cid" : "3", "id" : "8", "name":"蚌埠市"},'+ '{"cid" : "3", "id" : "9", "name":"张家⼝"}'+ '],'+ '"county" : ['+ '{"cid" : "1", "id" : "1", "name":"中关村"},'+ '{"cid" : "1", "id" : "2", "name":"五道⼝"},'+ '{"cid" : "2", "id" : "3", "name":"西直门"},'+ '{"cid" : "2", "id" : "4", "name":"新街⼝"},'+ '{"cid" : "2", "id" : "5", "name":"⼩西天"},'+ '{"cid" : "3", "id" : "6", "name":"东直门"},'+ '{"cid" : "3", "id" : "7", "name":"雍和宫"},'+ '{"cid" : "3", "id" : "8", "name":"北新桥"},'+ '{"cid" : "5", "id" : "9", "name":"城区"},'+ '{"cid" : "5", "id" : "10", "name":"南郊区"},'+ '{"cid" : "5", "id" : "11", "name":"开发区"}'+ ']'+'}';;(function($, window, document, undefined){$.fn.showCity = function(opt){this.defaults = {'cityjson' : cityjson, //json字符串变量名'defaultShow' : false, //市、县是否显⽰,默认不显⽰'showCounty' : true, //是否显⽰县'defaultCity' : [0,0,0] //默认城市,对应id};this.options = $.extend({}, this.defaults, opt);var oCityJson = eval('('+this.options.cityjson+')'),oProvince = $('.province',this),oCity = $('.city',this),oCounty = $('.county',this),provinces = oCityJson.province,citys = oCityJson.city,countys = oCityJson.county;//创建省this.creatProvince = function(){var html = '';for(var i=0; i<provinces.length; i++){html += '<option value='+provinces[i].id+'>'+provinces[i].name+'</option>';}oProvince.append(html);};this.creat = function(){oProvince.html('<option value="0">选择省</option>');this.creatProvince();if(this.options.defaultShow){oCity.show();oCounty.show();oCity.html('<option value="0">选择市</option>');oCounty.html('<option value="0">选择县</option>');};this.defaultCity();this.checkProvince();if(this.options.showCounty){this.checkCounty();}};//默认城市this.defaultCity = function(){if(this.options.defaultCity.toString() == '0,0,0'){return;};var optionsCity = '';for(var i=0; i<provinces.length; i++){if(provinces[i].id == this.options.defaultCity[0]){oProvince.val(provinces[i].id);for(var j=0; j<citys.length; j++){if(citys[j].cid == provinces[i].id){optionsCity += '<option value='+citys[j].id+'>'+citys[j].name+'</option>'}}oCity.append(optionsCity).show();}};var optionscounty = '';for(var i=0; i<citys.length; i++){if(citys[i].id == this.options.defaultCity[1] && citys[i].cid == oProvince.val()){oCity.val(citys[i].id);if(this.options.showCounty){for(var j=0; j<countys.length; j++){if(countys[j].cid == citys[i].id){optionscounty += '<option value='+countys[j].id+'>'+countys[j].name+'</option>'; }}oCounty.append(optionscounty).show();}}};if(this.options.showCounty){for(var i=0; i<countys.length; i++){if(countys[i].id == this.options.defaultCity[2] && countys[i].cid == oCity.val()){oCounty.val(countys[i].id);}};}}this.checkProvince = function(){oProvince.bind('change',function(){var html = '<option value="0">选择市</option>';var val = $(this).val();for(var i=0; i<citys.length; i++){if(citys[i].cid == val){html += '<option value='+citys[i].id+'>'+citys[i].name+'</option>'}}oCity.html(html).show();oCounty.html('<option value="0">选择县</option>');})};this.checkCounty = function(){oCity.bind('change',function(){var html = '<option value="0">选择县</option>';var val = $(this).val();for(var i=0; i<countys.length; i++){if(countys[i].cid == val){html += '<option value='+countys[i].id+'>'+countys[i].name+'</option>'}}oCounty.html(html).show();})};return this.creat();}}(jQuery, window, document))$(function(){$('#selectItem').showCity({"defaultCity" : [2,5,10]});})</script></head><body><div class="selectItem" id="selectItem"><select class="province"></select><select class="city" style="display:none"></select> <select class="county" style="display:none"></select> </div></body></html>。
省市区三级联动(附j全国省市区json文件)
label { display: inline-block; width:80px;
} #logisticPointForm div {
margin-top:10px; margin-bottom:10px; } </style> <script> $('#LatestDate').datetimebox({ required : true, onShowPanel:function(){
<div class="easyui-panel" style="padding:10px;"> <form id="logisticPointForm" method="post"> <div> <label>交接点:</label> <input class="easyui-textbox" id="PointName" name="PointName" data-options="required:true" style="width:70%;"> </div> <div> <label>选择区域:</label> <input class="easyui-combobox" id="Province" name="Province" style="width:22%" , data-options="prompt:'省',required:true,editable:false,"> <input class="easyui-combobox" id="City" name="City" style="width:22%" , data-options="prompt:'市',required:true,editable:false,"> <input class="easyui-combobox" id="County" name="County" style="width:22%" , data-options="prompt:'区/镇',required:true,editable:false,"> </div> <div> <label>详细地址:</label> <input class="easyui-textbox" id="Address" name="Address" data-options="required:true" style="width:70%;"> </div> <div> <label>对方物流员:</label> <input class="easyui-linkbutton" id="OppositeLogister" name="OppositeLogister" style="height:30px;" value="+选择物流员" onclick="sectionManageObj.choiceLogisterDialog(1)" /> <input id="OppositeLogisterId" name="OppositeLogisterId" type="hidden" /> </div> <div> <label>我方物流员:</label> <input class="easyui-linkbutton" id="MyLogister" name="MyLogister" style="height:30px;" value="+选择物流员" onclick="sectionManageObj.choiceLogisterDialog(2)"/> <input id="MyLogisterId" name="MyLogisterId" type="hidden"/> </div> <div> <label>最晚交接时间:</label> <!--<input class="easyui-datetimebox" id="LatestDate" name="LatestDate" style="width:30%" ,required:true, data-options="onShowPanel:function(){$(this).datetimebox('spinner').timespinner('setValue','00:00:00')}" >--> <input class="easyui-timespinner" id="LatestDate" name="LatestDate" required="required" data-options="width:'30%',showSeconds:true"> </div> <div style="text-align:center;"> <input href="#" class="easyui-linkbutton" value="取消" style="width:100px;height:30px;text-align:center;border-radius:5px;background:dimgray;color:white;" data-options="onClick:sectionManageObj.closeAddDialog <input href="#" class="easyui-linkbutton" value="确认" style="width:100px;height:30px;text-align:center;border-radius:5px;background:dodgerblue;color:white;" data-options="onClick:sectionManageObj.addSubmitDialog </div> </form>
省市区三级联动数据库代码(国家统计局最新代码、包含整理步骤)
省市区三级联动数据库代码(国家统计局最新代码、包含整理步骤)最终整理后的成果图。
最近项⽬要⽤到省市区地址三级联动。
原有的数据是⽼版本的。
在⽹上找了找,发现很多,也很杂。
最终决定⾃⼰整理⼀份,就当练⼿了。
看到的数据只有代码和名称两列数据如:110000 北京市110100 市辖区110101 东城区去空格整理后复制到excel 表中供导⼊数据库1、⾸先要把地址分出 1 、2 、3 级代表省、市、区。
那么问题来了。
原先想依据名称列的缩进来进⾏区分,但是想想有点复杂,⽽且容易出错。
后来⽤地区的编码规律来区分编码为 6 个字符组成例如:110101⾸先把表结构建起来吧。
从Excel表导⼊数据吧,这个就不说咯现在开始了!如果后4位为"0000" ---------------------是省级 1UPDATE[region]SET level=1WHERE SUBSTRING(code,3,6) ='0000'GO如果后2位为"00" 和等级level 不等于1----------是市级 2UPDATE[Test].[dbo].[region]SET[level]=2WHERE SUBSTRING(code,5,6) ='00'and ([level]<>1 ro [level] is null)GO备注:什么?执⾏了没效果?先把 level 字段赋值为 0 吧。
UPDATE [region]SET level = 0WHERE level is nullGO其他的 -----------------------------------是区级 3UPDATE[region]SET level=3WHERE level = 0GO2、现在我们来把⽗ID 整理出来也是依靠地址编码看代码就懂了啦省级UPDATE[region]SET parent_id =0WHERE level=1GO市级UPDATE aSET a.[parent_id]= b.[id]from[region] a,[region] bWHERE SUBSTRING(a.[code],1,2) =SUBSTRING(b.[code],1,2) and a.[level]=2and b.[level]=1GO区级UPDATE aSET a.[parent_id]= b.[id]from[region] a,[region] bWHERE SUBSTRING(a.[code],1,4) =SUBSTRING(b.[code],1,4) and a.[level]=3and b.[level]=2GO3、整理地区全称(这个字段有必要整理出来,原因嘛,选择联动地区获得省市区地址名称的时候会有意外的惊喜!例如:北京市市辖区XXX区,北京市县XXX县虽然没错但是影响美观)直接上代码:UPDATE[region]SET text_full =textWHERE id = id and level=1GOUPDATE aSET a.text_full = b.text_full + a.text from[region] a,[region] bWHERE a.parent_id = b.id and a.[level]=2and b.[level]=1GOUPDATE aSET a.text_full = b.text_full + a.text_full from[region] a,[region] bWHERE a.parent_id = b.id and a.[level]=3and b.[level]=2GO现在好了,看下检查下数据。
全国省市编码表JSON格式
全国省市编码表JSON格式var cityData3 = [{value: '110000',text: '北京市',children: [{value: "110100",text: "北京市",children: [{value: "110101",text: "东城区"}, {value: "110102",text: "西城区"},{value: "110105",text: "朝阳区"}, {value: "110106",text: "丰台区"}, {value: "110107",text: "石景山区"}, {value: "110108",text: "海淀区"}, {value: "110109",text: "门头沟区"}, {value: "110111", text: "房山区" }, {value: "110112", text: "通州区" }, {value: "110113", text: "顺义区" }, {value: "110114", text: "昌平区" }, {value: "110115", text: "大兴区" }, {value: "110116", }, {value: "110117", text: "平谷区" }, {value: "110118", text: "密云区" }, {value: "110119", text: "延庆区" }]}]}, {value: '120000', text: '天津市',children: [{ value: "120100", text: "天津市", children: [{ value: "120101", text: "和平区" }, {value: "120102", text: "河东区" }, {value: "120103", text: "河西区" }, {value: "120104", text: "南开区" }, {value: "120105", text: "河北区" }, {value: "120106", text: "红桥区" }, {value: "120110", text: "东丽区" }, {value: "120111", text: "西青区" }, {value: "120112", }, {value: "120113", text: "北辰区" }, {value: "120114", text: "武清区" }, {value: "120115", text: "宝坻区" }, {value: "120116", text: "滨海新区" }, {value: "120117", text: "宁河区" }, {value: "120118", text: "静海区" }, {value: "120119", text: "蓟州区" }]}]}, {value: '130000', text: '河北省', children: [{ value: "130100", text: "石家庄市", children: [{ value: "130102",text: "长安区" },{value: "130104", text: "桥西区" }, {value: "130105", text: "新华区" }, {value: "130107", text: "井陉矿区" }, {value: "130108",。
省市区-三级联动通用化模块组件
省市区-三级联动通⽤化模块组件都说我们要做模块化设计,⽽不要做功能化设计什么是模块化设计,就是可插拔性⾼,组件化,想要就⽤,不要⽤拉倒,直接删除就⾏什么是功能化设计,就是⼀个简单的功能,实现想要的效果,但是不够通⽤化,别⼈要⽤的话需要读懂你的代码,还需要复制黏贴很多代码这样效率不⾼今天写了⼀个省市区三级联动的模块,写完后使⽤会⾮常⽅便,也很灵活主要使⽤到的技术:jquery,redis,springMVC,MyBatis(springMVC和MyBatis⽆所谓,你⽤struts或者hibernate或者spring data都⾏)⾸先页⾯引⼊js1<script src="/js/jquery-2.2.4.min.js"></script>2<script src="/cityselect/js/jquery.cityselect.js"></script>HTML中写⼊3个div块,这是互斥的,div#id不同就可以做到模块化可插拔1<div id="city">2<select class="prov"></select>3<select class="city" disabled="disabled"></select>4<select class="dist" disabled="disabled"></select>5</div>67<div id="city2">8<select class="prov"></select>9<select class="city" disabled="disabled"></select>10<select class="dist" disabled="disabled"></select>11</div>1213<div id="city3">14<select class="prov"></select>15<select class="city" disabled="disabled"></select>16<select class="dist" disabled="disabled"></select>17</div>初始化JS:<script type="text/javascript">/**** @Description: 省市区三级联动api* Copyright: Copyright (c) 2016** ==============================* 参数说明* url:省市数据josn⽂件路径* prov:默认省份* city:默认城市* dist:默认地区(县)* nodata:⽆数据状态* required:必选项* ==============================** @author leechenxiang* @date 2016年6⽉16⽇下午3:46:58* @version V1.0*/$(function(){$("#city").citySelect({prov:"江苏省",city:"⽆锡市",dist:"南长区",required:false});$("#city2").citySelect({nodata:"none",required:false});$("#city3").citySelect({nodata:"none",required:false});});</script>后台controller:1/**2 *3 * @Description: 获取所有的省市区列表4 * @return5 * @throws Exception6 *7 * @author leechenxiang8 * @date 2016年6⽉16⽇上午11:22:109*/10 @RequestMapping("/getCities")11 @ResponseBody12public CitiesDataResult getCities() throws Exception {13 CitiesDataResult areas = commonService.getAllCities();14return areas;15 }service:1 @Override2public CitiesDataResult getAllCities() {3// 取出缓存4try {5 String citiesDataResult = jedisClient.get(REDIS_CITIES_KEY);6if (!StringUtils.isBlank(citiesDataResult)) {7 CitiesDataResult redisResult = JsonUtils.jsonToPojo(citiesDataResult, CitiesDataResult.class); 8return redisResult;9 }10 } catch (Exception e1) {11 e1.printStackTrace();12 }1314 List<AreaProvince> provinceList = areaProvinceMapper.getProvinceList();15 List<Province> pList = new ArrayList<Province>();16for (AreaProvince province : provinceList) {17int provinceId = province.getProvinceId();18 String provinceName = province.getProvinceName();1920 List<AreaCity> cityList = areaProvinceMapper.getCityListBypId(provinceId);21 List<City> cList = new ArrayList<City>();22for (AreaCity city : cityList) {23int cityId = city.getCityId();24 String cityName = city.getCityName();2526 List<District> districtList = areaProvinceMapper.getDistrictListBycId(cityId);2728 City c = new City();29 c.setN(cityName);30 c.setA(districtList);31 cList.add(c);32 }3334 Province p = new Province(provinceName, cList);35 pList.add(p);36 }3738 CitiesDataResult result = new CitiesDataResult();39 result.setCitylist(pList);4041// 放⼊缓存42try {43 jedisClient.set(REDIS_CITIES_KEY, JsonUtils.objectToJson(result));44 } catch (Exception e) {45 e.printStackTrace();46 }4748return result;49 }如果需要默认选中那么只需要对这3个参数赋值即可:prov:"江苏省",city:"⽆锡市",dist:"南长区",对于省市区的数据源,可以存放在数据库表中,也可以直接存⼊js,作为⼀个json来调⽤即可如果没有省市区可以淘⼀下万能的X宝,可以参考如下链接,真的是太强⼤了,把省市区直接细化到了极致:。
全国省市县三级联动(数据完整版)
全国省市县三级联动(数据完整版)网页前台代码:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Defaul t" EnableEventValidation="false"%><%@ Register assembly="AjaxControlToolkit"namespace="AjaxControlToolkit" tagprefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""/TR/xhtml 1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml"><head runat="server"><title>无标题页</title></head><body><form id="form1" runat="server"><div align="center"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><fieldset ><legend>全国省市县</legend><fieldset style="width: 265px"><legend>省</legend><asp:DropDownList ID="DropDownList1" runat="server"AutoPostBack="True"></asp:DropDownList><cc1:CascadingDropDown ID="DropDownList1_CascadingDropDown" runat="server"Category="provice" Enabled="True" LoadingText="读取数据中.." PromptText="请选择省"TargetControlID="DropDownList1" ServicePath="WebService.asmx" ServiceMethod ="GetproviceNames"></cc1:CascadingDropDown></fieldset><fieldset style="width: 266px"><legend>市</legend><asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"></asp:DropDownList><cc1:CascadingDropDown ID="DropDownList2_CascadingDropDown" runat="server"Category="city" Enabled="True" TargetControlID="DropDownList2" LoadingText="读取数据中.." PromptText="请选择市" ParentControlID="DropDownList1"ServicePath="WebService.asmx" ServiceMethod="GetCityNames"></cc1:CascadingDropDown></fieldset><fieldset style="width: 266px"><legend>县</legend><asp:DropDownList ID="DropDownList3" runat="server"></asp:DropDownList><cc1:CascadingDropDown ID="DropDownList3_CascadingDropDown" runat="server" Ca tegory="District" TargetControlID="DropDownList3"Enabled="True" LoadingText="读取数据中.." ParentControlID="DropDownList2"ServicePath="WebService.asmx" ServiceMethod="GetDistrictNames"></cc1:CascadingDropDown></fieldset></fieldset></div></form></body></html>WebService代码using System;using System.Collections;using System.Linq;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Xml.Linq;//访问数据库命名空间using System.Data;using System.Data.SqlClient;//访问web.config命名空间using System.Web.Configuration;//导入ScriptServiceAttribute类的命名空间using System.Web.Script.Services;//返回CascadingDropDownNameValue数组所需的命名空间using AjaxControlToolkit;using System.Collections.Generic;using System.Collections.Specialized;///<summary>///WebService 的摘要说明///</summary>[WebService(Namespace = "/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]//若要允许使用 AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
【示例代码及地区json】js省市区三级联动
【⽰例代码及地区json】js省市区三级联动存在bug:1. 不能初始化市区,只能初始化省2. 当选择完毕市区之后,再改变省,区只能清空不可以初始化js代码:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Document</title></head><body><select name="" id="Province"><option value="">请选择省</option></select><select name="" id="City"><option value="">请先选择省</option></select><select name="" id="District"><option value="">请先选择市</option></select><script src="area_data.js"></script><script>var Province,City,District;Province = document.getElementById("Province");City = document.getElementById("City");District = document.getElementById("District");// 初始化(function(){var ProvinceHtml = "";region.forEach(function(index){ProvinceHtml += "<option value='"+index.provinceCode+"'>"+index.provinceName+"</option>";});Province.innerHTML = ProvinceHtml;})()Province.onchange = function(){var that = this;var CityHtml = "";// 初始化县District.innerHTML = "<option value=''>请先选择市</option>";region.forEach(function(index){if(index.provinceCode == that.value){index.mallCityList.forEach(function(child){CityHtml += "<option value='"+child.cityCode+"'>"+child.cityName+"</option>";});City.innerHTML = CityHtml;return ;}});};City.onchange = function(){var that = this;var DistrictHtml = "";region.forEach(function(index){if(index.provinceCode == Province.value){index.mallCityList.forEach(function(child){if(child.cityCode == that.value){child.mallAreaList.forEach(function(sun){DistrictHtml += "<option value='"+sun.areaCode+"'>"+sun.areaName+"</option>";});District.innerHTML = DistrictHtml;return ;}});}});};</script></body></html>var region = [{"provinceCode": "110000","provinceName": "北京市","mallCityList": [{"cityCode": "110100","cityName": "北京市","mallAreaList": [{"areaCode": "110101", "areaName": "东城区" },{"areaCode": "110102", "areaName": "西城区" },{"areaCode": "110105", "areaName": "朝阳区" },{"areaCode": "110106", "areaName": "丰台区" },{"areaCode": "110107", "areaName": "⽯景⼭区" },{"areaCode": "110108", "areaName": "海淀区" },{"areaCode": "110109", "areaName": "门头沟区" },{"areaCode": "110111", "areaName": "房⼭区" },{"areaCode": "110112", "areaName": "通州区" },{"areaCode": "110113", "areaName": "顺义区" },{"areaCode": "110114", "areaName": "昌平区" },{"areaCode": "110115", "areaName": "⼤兴区" },{"areaCode": "110116", "areaName": "怀柔区" },{"areaCode": "110117", "areaName": "平⾕区" }]},{"cityCode": "110200","cityName": "北京市辖县","mallAreaList": [{"areaCode": "110228", "areaName": "密云县" },{"areaCode": "110229", "areaName": "延庆县" }]"provinceCode": "120000","provinceName": "天津市","mallCityList": [{"cityCode": "120100","cityName": "天津市","mallAreaList": [{"areaCode": "120101", "areaName": "和平区" },{"areaCode": "120102", "areaName": "河东区" },{"areaCode": "120103", "areaName": "河西区" },{"areaCode": "120104", "areaName": "南开区" },{"areaCode": "120105", "areaName": "河北区" },{"areaCode": "120106", "areaName": "红桥区" },{"areaCode": "120110", "areaName": "东丽区" },{"areaCode": "120111", "areaName": "西青区" },{"areaCode": "120112", "areaName": "津南区" },{"areaCode": "120113", "areaName": "北⾠区" },{"areaCode": "120114", "areaName": "武清区" },{"areaCode": "120115", "areaName": "宝坻区" },{"areaCode": "120116", "areaName": "滨海新区" }]},{"cityCode": "120200","cityName": "天津市辖县","mallAreaList": [{"areaCode": "120221", "areaName": "宁河县" },{"areaCode": "120223", "areaName": "静海县" },{"areaCode": "120225", "areaName": "蓟县"}]}]"mallCityList": [{"cityCode": "130100","cityName": "⽯家庄市","mallAreaList": [{"areaCode": "130102", "areaName": "长安区" },{"areaCode": "130104", "areaName": "桥西区" },{"areaCode": "130105", "areaName": "新华区" },{"areaCode": "130107", "areaName": "井陉矿区" },{"areaCode": "130108", "areaName": "裕华区" },{"areaCode": "130109", "areaName": "藁城区" },{"areaCode": "130110", "areaName": "⿅泉区" },{"areaCode": "130111", "areaName": "栾城区" },{"areaCode": "130121", "areaName": "井陉县" },{"areaCode": "130123", "areaName": "正定县" },{"areaCode": "130125", "areaName": "⾏唐县" },{"areaCode": "130126", "areaName": "灵寿县" },{"areaCode": "130127", "areaName": "⾼⾢县" },{"areaCode": "130128", "areaName": "深泽县" },{"areaCode": "130129", "areaName": "赞皇县" },{"areaCode": "130130", "areaName": "⽆极县" },{"areaCode": "130131", "areaName": "平⼭县" },{"areaCode": "130132", "areaName": "元⽒县" },{"areaCode": "130133", "areaName": "赵县"},{"areaCode": "130184", "areaName": "新乐市" }]},{"cityCode": "130200","cityName": "唐⼭市","mallAreaList": [{"areaCode": "130202", "areaName": "路南区" },{"areaCode": "130203", "areaName": "路北区" },{"areaCode": "130204", "areaName": "古冶区" },{"areaCode": "130205", "areaName": "开平区" },{"areaCode": "130207", "areaName": "丰南区" },{"areaCode": "130208", "areaName": "丰润区" },{"areaCode": "130209", "areaName": "曹妃甸区" },{"areaCode": "130223", "areaName": "滦县"},{"areaCode": "130224", "areaName": "滦南县" },{"areaCode": "130225", "areaName": "乐亭县" },{"areaCode": "130227", "areaName": "迁西县" },{"areaCode": "130229", "areaName": "⽟⽥县" },{"areaCode": "130281", "areaName": "遵化市" },{"areaCode": "130283", "areaName": "迁安市" }]},{"cityCode": "130300","cityName": "秦皇岛市","mallAreaList": [{"areaCode": "130302", "areaName": "海港区"},{"areaCode": "130321","areaName": "青龙满族⾃治县" },{"areaCode": "130322","areaName": "昌黎县"},{"areaCode": "130323","areaName": "抚宁县"},{"areaCode": "130324","areaName": "卢龙县"}]},{"cityCode": "130400","cityName": "邯郸市","mallAreaList": [{"areaCode": "130402","areaName": "邯⼭区"},{"areaCode": "130403","areaName": "丛台区"},{"areaCode": "130404","areaName": "复兴区"},{"areaCode": "130406","areaName": "峰峰矿区"},{"areaCode": "130421","areaName": "邯郸县"},{"areaCode": "130423","areaName": "临漳县"},{"areaCode": "130424","areaName": "成安县"},{"areaCode": "130425","areaName": "⼤名县"},{"areaCode": "130426","areaName": "涉县"},{"areaCode": "130427","areaName": "磁县"},{"areaCode": "130428","areaName": "肥乡县"},{"areaCode": "130429","areaName": "永年县"},{"areaCode": "130430","areaName": "邱县"},{"areaCode": "130432", "areaName": "⼴平县" },{"areaCode": "130433", "areaName": "馆陶县" },{"areaCode": "130434", "areaName": "魏县" },{"areaCode": "130435", "areaName": "曲周县" },{"areaCode": "130481", "areaName": "武安市" }]},{"cityCode": "130500","cityName": "邢台市","mallAreaList": [{"areaCode": "130502", "areaName": "桥东区" },{"areaCode": "130503", "areaName": "桥西区" },{"areaCode": "130521", "areaName": "邢台县" },{"areaCode": "130522", "areaName": "临城县" },{"areaCode": "130523", "areaName": "内丘县" },{"areaCode": "130524", "areaName": "柏乡县" },{"areaCode": "130525", "areaName": "隆尧县" },{"areaCode": "130526", "areaName": "任县" },{"areaCode": "130527", "areaName": "南和县" },{"areaCode": "130528", "areaName": "宁晋县" },{"areaCode": "130529", "areaName": "巨⿅县" },{"areaCode": "130530", "areaName": "新河县" },{"areaCode": "130531", "areaName": "⼴宗县" },{"areaCode": "130532", "areaName": "平乡县"},{"areaCode": "130534", "areaName": "清河县" },{"areaCode": "130535", "areaName": "临西县" },{"areaCode": "130581", "areaName": "南宫市" },{"areaCode": "130582", "areaName": "沙河市" }]},{"cityCode": "130600","cityName": "保定市","mallAreaList": [{"areaCode": "130602", "areaName": "新市区" },{"areaCode": "130603", "areaName": "北市区" },{"areaCode": "130604", "areaName": "南市区" },{"areaCode": "130621", "areaName": "满城县" },{"areaCode": "130622", "areaName": "清苑县" },{"areaCode": "130623", "areaName": "涞⽔县" },{"areaCode": "130624", "areaName": "⾩平县" },{"areaCode": "130625", "areaName": "徐⽔县" },{"areaCode": "130626", "areaName": "定兴县" },{"areaCode": "130627", "areaName": "唐县" },{"areaCode": "130628", "areaName": "⾼阳县" },{"areaCode": "130629", "areaName": "容城县" },{"areaCode": "130630", "areaName": "涞源县" },{"areaCode": "130631", "areaName": "望都县" },{"areaCode": "130633", "areaName": "易县"},{"areaCode": "130634", "areaName": "曲阳县" },{"areaCode": "130635", "areaName": "蠡县"},{"areaCode": "130636", "areaName": "顺平县" },{"areaCode": "130637", "areaName": "博野县" },{"areaCode": "130638", "areaName": "雄县"},{"areaCode": "130681", "areaName": "涿州市" },{"areaCode": "130682", "areaName": "定州市" },{"areaCode": "130683", "areaName": "安国市" },{"areaCode": "130684", "areaName": "⾼碑店市" }]},{"cityCode": "130700","cityName": "张家⼝市","mallAreaList": [{"areaCode": "130702", "areaName": "桥东区" },{"areaCode": "130703", "areaName": "桥西区" },{"areaCode": "130705", "areaName": "宣化区" },{"areaCode": "130706", "areaName": "下花园区" },{"areaCode": "130721", "areaName": "宣化县" },{"areaCode": "130722", "areaName": "张北县" },{"areaCode": "130723", "areaName": "康保县" },{"areaCode": "130724", "areaName": "沽源县" },{"areaCode": "130725", "areaName": "尚义县"},{"areaCode": "130727","areaName": "阳原县"},{"areaCode": "130728","areaName": "怀安县"},{"areaCode": "130729","areaName": "万全县"},{"areaCode": "130730","areaName": "怀来县"},{"areaCode": "130731","areaName": "涿⿅县"},{"areaCode": "130732","areaName": "⾚城县"},{"areaCode": "130733","areaName": "崇礼县"}]},{"cityCode": "130800","cityName": "承德市","mallAreaList": [{"areaCode": "130802","areaName": "双桥区"},{"areaCode": "130803","areaName": "双滦区"},{"areaCode": "130804","areaName": "鹰⼿营⼦矿区"},{"areaCode": "130821","areaName": "承德县"},{"areaCode": "130822","areaName": "兴隆县"},{"areaCode": "130823","areaName": "平泉县"},{"areaCode": "130824","areaName": "滦平县"},{"areaCode": "130825","areaName": "隆化县"},{"areaCode": "130826","areaName": "丰宁满族⾃治县"},{"areaCode": "130827","areaName": "宽城满族⾃治县"},{"areaCode": "130828","areaName": "围场满族蒙古族⾃治县" }]"mallAreaList": [{"areaCode": "130902","areaName": "新华区"},{"areaCode": "130903","areaName": "运河区"},{"areaCode": "130921","areaName": "沧县"},{"areaCode": "130922","areaName": "青县"},{"areaCode": "130923","areaName": "东光县"},{"areaCode": "130924","areaName": "海兴县"},{"areaCode": "130925","areaName": "盐⼭县"},{"areaCode": "130926","areaName": "肃宁县"},{"areaCode": "130927","areaName": "南⽪县"},{"areaCode": "130928","areaName": "吴桥县"},{"areaCode": "130929","areaName": "献县"},{"areaCode": "130930","areaName": "孟村回族⾃治县" },{"areaCode": "130981","areaName": "泊头市"},{"areaCode": "130982","areaName": "任丘市"},{"areaCode": "130983","areaName": "黄骅市"},{"areaCode": "130984","areaName": "河间市"}]},{"cityCode": "131000","cityName": "廊坊市","mallAreaList": [{"areaCode": "131002","areaName": "安次区"},{"areaCode": "131003","areaName": "⼴阳区"},{"areaCode": "131023","areaName": "永清县"},{"areaCode": "131024","areaName": "⾹河县"},{"areaCode": "131025","areaName": "⼤城县"},{"areaCode": "131026","areaName": "⽂安县"},{"areaCode": "131028","areaName": "⼤⼚回族⾃治县" },{"areaCode": "131081","areaName": "霸州市"},{"areaCode": "131082","areaName": "三河市"}]},{"cityCode": "131100","cityName": "衡⽔市","mallAreaList": [{"areaCode": "131102","areaName": "桃城区"},{"areaCode": "131121","areaName": "枣强县"},{"areaCode": "131122","areaName": "武⾢县"},{"areaCode": "131123","areaName": "武强县"},{"areaCode": "131124","areaName": "饶阳县"},{"areaCode": "131125","areaName": "安平县"},{"areaCode": "131126","areaName": "故城县"},{"areaCode": "131127","areaName": "景县"},{"areaCode": "131128","areaName": "⾩城县"},{"areaCode": "131181","areaName": "冀州市"},{"areaCode": "131182","areaName": "深州市"}]}]"mallCityList": [{"cityCode": "140100","cityName": "太原市","mallAreaList": [{"areaCode": "140105", "areaName": "⼩店区" },{"areaCode": "140106", "areaName": "迎泽区" },{"areaCode": "140107", "areaName": "杏花岭区" },{"areaCode": "140108", "areaName": "尖草坪区" },{"areaCode": "140109", "areaName": "万柏林区" },{"areaCode": "140110", "areaName": "晋源区" },{"areaCode": "140121", "areaName": "清徐县" },{"areaCode": "140122", "areaName": "阳曲县" },{"areaCode": "140123", "areaName": "娄烦县" },{"areaCode": "140181", "areaName": "古交市" }]},{"cityCode": "140200","cityName": "⼤同市","mallAreaList": [{"areaCode": "140202", "areaName": "城区"},{"areaCode": "140203", "areaName": "矿区"},{"areaCode": "140211", "areaName": "南郊区" },{"areaCode": "140212", "areaName": "新荣区" },{"areaCode": "140221", "areaName": "阳⾼县" },{"areaCode": "140222", "areaName": "天镇县" },{"areaCode": "140223", "areaName": "⼴灵县" },{"areaCode": "140226", "areaName": "左云县" },{"areaCode": "140227", "areaName": "⼤同县" }]},{"cityCode": "140300","cityName": "阳泉市","mallAreaList": [{"areaCode": "140302", "areaName": "城区" },{"areaCode": "140303", "areaName": "矿区" },{"areaCode": "140311", "areaName": "郊区" },{"areaCode": "140321", "areaName": "平定县" },{"areaCode": "140322", "areaName": "盂县" }]},{"cityCode": "140400","cityName": "长治市","mallAreaList": [{"areaCode": "140402", "areaName": "城区" },{"areaCode": "140411", "areaName": "郊区" },{"areaCode": "140421", "areaName": "长治县" },{"areaCode": "140423", "areaName": "襄垣县" },{"areaCode": "140424", "areaName": "屯留县" },{"areaCode": "140425", "areaName": "平顺县" },{"areaCode": "140426", "areaName": "黎城县" },{"areaCode": "140427", "areaName": "壶关县" },{"areaCode": "140428", "areaName": "长⼦县" },{"areaCode": "140431", "areaName": "沁源县" },{"areaCode": "140481", "areaName": "潞城市" }]},{"cityCode": "140500","cityName": "晋城市","mallAreaList": [{"areaCode": "140502", "areaName": "城区" },{"areaCode": "140521", "areaName": "沁⽔县" },{"areaCode": "140522", "areaName": "阳城县" },{"areaCode": "140524", "areaName": "陵川县" },{"areaCode": "140525", "areaName": "泽州县" },{"areaCode": "140581", "areaName": "⾼平市" }]},{"cityCode": "140600","cityName": "朔州市","mallAreaList": [{"areaCode": "140602", "areaName": "朔城区" },{"areaCode": "140603", "areaName": "平鲁区" },{"areaCode": "140621", "areaName": "⼭阴县" },{"areaCode": "140622", "areaName": "应县" },{"areaCode": "140623", "areaName": "右⽟县" },{"areaCode": "140624", "areaName": "怀仁县" }]},{"cityCode": "140700","cityName": "晋中市","mallAreaList": [{"areaCode": "140702", "areaName": "榆次区"。
省市区三级联动
省市区三级联动HTML<div class="am-form-content address"> <select name="province" id="province" onchange="loadRegion('province',2,'city');"><option value="0" selected>省份/直辖市</option>{volist name="province" id="vo"} <option value="{$vo.id}" >{$}</option>{/volist}</select><select name="city" id="city" onchange="loadRegion('city',3,'town');"><option value="0">市/县</option></select><select name="town" id="town"><option value="0">镇/区</option></select></div>⽅法public function address(){$where['uid']=cookie('id');$sql=db('ress')->field('a.*, as shengnamne, as shiname , as qname') ->where($where)->alias('a')->join('tree b','a.sheng=b.id')->join('tree c','a.shi=c.id')->join('tree d','a.qu=d.id')->select();// var_dump($sql);if($sql){$this->assign('sql',$sql);}else{$this->assign('sql','');}//三级联动上⾯与三级联动没关系$province = Db('tree')->where ( array('pid'=>1) )->select ();//进⼊页⾯直接查询省并赋值到页⾯ $this->assign('province',$province);return $this->fetch();}//三级联动public function getRegion(){$map['pid']=$_REQUEST["pid"];//查询⽗id$map['type']=$_REQUEST["type"];//查询那⼀级// $list=$Region->where($map)->select();$list = db('tree')->where($map)->select();// echo json_encode($list);return $list;}<!-- 省市区三联动 js --><script>function loadRegion(sel,type_id,selName,url="{:url('Index/getRegion')}"){jQuery("#"+selName+" option").each(function(){jQuery(this).remove();});// jQuery("<option value=0>请选择</option>").appendTo(jQuery("#"+selName));$('#'+selName).append('<option value=0>请选择</option>');if(jQuery("#"+sel).val()==0){return;}$.ajax({url:url,data:{pid:jQuery("#"+sel).val(),type:type_id},dataType:'json',type:'get',success:function(data){if(data){jQuery.each(data,function(idx,item){jQuery("<option value="+item.id+">"++"</option>").appendTo(jQuery("#"+selName)); });}else{jQuery("<option value='0'>请选择</option>").appendTo(jQuery("#"+selName));}}})jQuery.getJSON(url,{pid:jQuery("#"+sel).val(),type:type_id},function(data){if(data){jQuery.each(data,function(idx,item){jQuery("<option value="+item.id+">"++"</option>").appendTo(jQuery("#"+selName)); });}else{jQuery("<option value='0'>请选择</option>").appendTo(jQuery("#"+selName));}});}</script>数据库。
jason的格式
JSON是一种轻量级的数据交换格式,通常用于在不同应用程序之间传输和存储数据。
JSON 的基本格式如下:{"key1": "value1","key2": "value2","key3": "value3"}在JSON中,数据是以键值对(key-value pairs)的形式组织的。
每个键都是一个字符串,跟随一个冒号,然后是与该键关联的值。
值可以是字符串、数字、布尔值、数组、对象等。
键值对之间使用逗号分隔,整个数据结构包装在花括号{} 中。
以下是一个更复杂的JSON示例,其中包含嵌套对象和数组:{"name": "John Doe","age": 30,"email":"*******************","address": {"street": "123 Main St","city": "Anytown","zipcode": "12345"},"hobbies": ["reading", "swimming", "traveling"]}在这个示例中,address 是一个嵌套的对象,而hobbies 是一个包含多个元素的数组。
JSON格式的特点包括易于阅读和编写,通用性强,易于解析和生成,因此被广泛用于Web 应用程序和数据交换中。
通常,编程语言提供了内置的JSON解析和生成库,以便在应用程序中处理JSON数据。
三级联动城市选择json数据二
三级联动城市选择json数据⼆let cityData = [{value: "北京",label: "北京",children: [{value: "东城区",label: "东城区"},{value: "西城区",label: "西城区"},{value: "崇⽂区",label: "崇⽂区"},{value: "宣武区",label: "宣武区"},{value: "朝阳区",label: "朝阳区"},{value: "海淀区",label: "海淀区"},{value: "丰台区",label: "丰台区"},{value: "⽯景⼭区",label: "⽯景⼭区"},{value: "房⼭区",label: "房⼭区"},{value: "通州区",label: "通州区"},{value: "顺义区",label: "顺义区"},{value: "昌平区",label: "昌平区"},{value: "⼤兴区",label: "⼤兴区"},{value: "怀柔区",label: "怀柔区"},{value: "平⾕区",label: "平⾕区"},{value: "门头沟区",label: "门头沟区"},{value: "密云县",label: "密云县"},{value: "延庆县",label: "延庆县"},{value: "⼴东",label: "⼴东",children: [{value: "⼴州",label: "⼴州",children: [{value: "越秀区", label: "越秀区" },{value: "荔湾区", label: "荔湾区" },{value: "海珠区", label: "海珠区" },{value: "天河区", label: "天河区" },{value: "⽩云区", label: "⽩云区" },{value: "黄埔区", label: "黄埔区" },{value: "番禺区", label: "番禺区" },{value: "花都区", label: "花都区" },{value: "南沙区", label: "南沙区" },{value: "萝岗区", label: "萝岗区" },{value: "增城市", label: "增城市" },{value: "从化市", label: "从化市" },{value: "其他", label: "其他"}]},{value: "深圳",label: "深圳",children: [{value: "福⽥区", label: "福⽥区" },{value: "罗湖区", label: "罗湖区" },{value: "南⼭区", label: "南⼭区"value: "龙岗区", label: "龙岗区" },{value: "盐⽥区", label: "盐⽥区" },{value: "其他", label: "其他"}]},{value: "珠海",label: "珠海",children: [{value: "⾹洲区", label: "⾹洲区" },{value: "⽃门区", label: "⽃门区" },{value: "⾦湾区", label: "⾦湾区" },{value: "其他", label: "其他"}]},{value: "汕头",label: "汕头",children: [{value: "⾦平区", label: "⾦平区" },{value: "濠江区", label: "濠江区" },{value: "龙湖区", label: "龙湖区" },{value: "潮阳区", label: "潮阳区" },{value: "潮南区", label: "潮南区" },{value: "澄海区", label: "澄海区" },{value: "南澳县", label: "南澳县" },{value: "其他", label: "其他"}]},{value: "韶关",label: "韶关",children: [{value: "曲江区",label: "曲江区"},{value: "乐昌市",label: "乐昌市"},{value: "南雄市",label: "南雄市"},{value: "始兴县",label: "始兴县"},{value: "仁化县",label: "仁化县"},{value: "翁源县",label: "翁源县"},{value: "新丰县",label: "新丰县"},{value: "乳源瑶族⾃治县", label: "乳源瑶族⾃治县" },{value: "其他",label: "其他"}]},{value: "佛⼭",label: "佛⼭",children: [{value: "禅城区",label: "禅城区"},{value: "南海区",label: "南海区"},{value: "顺德区",label: "顺德区"},{value: "三⽔区",label: "三⽔区"},{value: "⾼明区",label: "⾼明区"},{value: "其他",label: "其他"}]},{value: "江门",label: "江门",children: [{value: "蓬江区",label: "蓬江区"},{value: "恩平市", label: "恩平市" },{value: "台⼭市", label: "台⼭市" },{value: "开平市", label: "开平市" },{value: "鹤⼭市", label: "鹤⼭市" },{value: "其他", label: "其他"}]},{value: "湛江",label: "湛江",children: [{value: "⾚坎区", label: "⾚坎区" },{value: "霞⼭区", label: "霞⼭区" },{value: "坡头区", label: "坡头区" },{value: "⿇章区", label: "⿇章区" },{value: "吴川市", label: "吴川市" },{value: "廉江市", label: "廉江市" },{value: "雷州市", label: "雷州市" },{value: "遂溪县", label: "遂溪县" },{value: "徐闻县", label: "徐闻县" },{value: "其他", label: "其他"}]},{value: "茂名",label: "茂名",children: [{value: "茂南区", label: "茂南区" },{value: "信宜市", label: "信宜市" },{value: "⾼州市", label: "⾼州市" },{value: "电⽩县", label: "电⽩县" },{value: "其他", label: "其他"}]},{value: "肇庆",label: "肇庆",children: [{value: "端州区", label: "端州区" },{value: "⿍湖区", label: "⿍湖区" },{value: "⾼要市", label: "⾼要市" },{value: "四会市", label: "四会市" },{value: "⼴宁县", label: "⼴宁县" },{value: "怀集县", label: "怀集县" },{value: "封开县", label: "封开县" },{value: "德庆县", label: "德庆县" },{value: "其他", label: "其他"}]},{value: "惠州",label: "惠州",children: [{value: "惠城区", label: "惠城区" },{value: "惠阳区", label: "惠阳区" },{value: "博罗县", label: "博罗县" },{value: "其他", label: "其他"}]},{value: "梅州",label: "梅州",children: [{value: "梅江区", label: "梅江区" },{value: "兴宁市", label: "兴宁市" },{value: "梅县", label: "梅县"},{value: "⼤埔县", label: "⼤埔县" },{value: "丰顺县", label: "丰顺县" },{value: "五华县", label: "五华县" },{value: "平远县", label: "平远县" },{value: "蕉岭县", label: "蕉岭县" },{value: "其他", label: "其他"}]},{value: "汕尾",label: "汕尾",children: [{value: "城区", label: "城区"},{value: "陆丰市", label: "陆丰市" },{value: "海丰县", label: "海丰县" },{value: "陆河县", label: "陆河县" },{value: "其他", label: "其他"}]},{value: "河源",label: "河源",value: "紫⾦县", label: "紫⾦县" },{value: "龙川县", label: "龙川县" },{value: "连平县", label: "连平县" },{value: "和平县", label: "和平县" },{value: "东源县", label: "东源县" },{value: "其他", label: "其他"}]},{value: "阳江",label: "阳江",children: [{value: "江城区", label: "江城区" },{value: "阳春市", label: "阳春市" },{value: "阳西县", label: "阳西县" },{value: "阳东县", label: "阳东县" },{value: "其他", label: "其他"}]},{value: "清远",label: "清远",children: [{value: "清城区", label: "清城区" },{value: "英德市", label: "英德市" },{value: "连州市", label: "连州市" },{value: "佛冈县", label: "佛冈县" },{value: "阳⼭县", label: "阳⼭县" },{value: "清新县", label: "清新县"value: "连南瑶族⾃治县",label: "连南瑶族⾃治县"},{value: "其他",label: "其他"}]},{value: "东莞",label: "东莞",children: [{ value: "东城街道", label: "东城街道" },{ value: "南城街道", label: "南城街道" },{ value: "万江街道", label: "万江街道" },{ value: "莞城街道", label: "莞城街道" },{ value: "⽯碣镇", label: "⽯碣镇" },{ value: "⽯龙镇", label: "⽯龙镇" },{ value: "茶⼭镇", label: "茶⼭镇" },{ value: "⽯排镇", label: "⽯排镇" },{ value: "企⽯镇", label: "企⽯镇" },{ value: "横沥镇", label: "横沥镇" },{ value: "桥头镇", label: "桥头镇" },{ value: "谢岗镇", label: "谢岗镇" },{ value: "东坑镇", label: "东坑镇" },{ value: "常平镇", label: "常平镇" },{ value: "寮步镇", label: "寮步镇" },{ value: "樟⽊头镇", label: "樟⽊头镇" },{ value: "⼤朗镇", label: "⼤朗镇" },{ value: "黄江镇", label: "黄江镇" },{ value: "清溪镇", label: "清溪镇" },{ value: "塘厦镇", label: "塘厦镇" },{ value: "凤岗镇", label: "凤岗镇" },{ value: "⼤岭⼭镇", label: "⼤岭⼭镇" },{ value: "长安镇", label: "长安镇" },{ value: "厚街镇", label: "厚街镇" },{ value: "沙⽥镇", label: "沙⽥镇" },{ value: "道滘镇", label: "道滘镇" },{ value: "洪梅镇", label: "洪梅镇" },{ value: "⿇涌镇", label: "⿇涌镇" },{ value: "虎门镇", label: "虎门镇" },{ value: "望⽜墩镇", label: "望⽜墩镇" },{ value: "中堂镇", label: "中堂镇" },{ value: "⾼埗镇", label: "⾼埗镇" },{ value: "松⼭湖管委会", label: "松⼭湖管委会" },{ value: "虎门港管委会", label: "虎门港管委会" },{ value: "东莞⽣态园", label: "东莞⽣态园" },{ value: "其他", label: "其他" }]},{value: "中⼭",label: "中⼭",children: [{ value: "⽯岐区街道", label: "⽯岐区街道" },{ value: "东区街道", label: "东区街道" },{ value: "⽕炬开发区街道", label: "⽕炬开发区街道" }, { value: "西区街道", label: "西区街道" },{ value: "南区街道", label: "南区街道" },{ value: "五桂⼭街道", label: "五桂⼭街道" },{ value: "⼩榄镇", label: "⼩榄镇" },{ value: "黄圃镇", label: "黄圃镇" },{ value: "民众镇", label: "民众镇" },{ value: "东凤镇", label: "东凤镇" },{ value: "东升镇", label: "东升镇" },{ value: "古镇镇", label: "古镇镇" },{ value: "沙溪镇", label: "沙溪镇" },{ value: "坦洲镇", label: "坦洲镇" },{ value: "港⼝镇", label: "港⼝镇" },{ value: "三⾓镇", label: "三⾓镇" },{ value: "横栏镇", label: "横栏镇" },{ value: "南头镇", label: "南头镇" },{ value: "⾩沙镇", label: "⾩沙镇" },{ value: "南朗镇", label: "南朗镇" },{ value: "三乡镇", label: "三乡镇" },{ value: "板芙镇", label: "板芙镇" },{ value: "⼤涌镇", label: "⼤涌镇" },value: "潮州",label: "潮州",children: [{value: "湘桥区", label: "湘桥区" },{value: "潮安县", label: "潮安县" },{value: "饶平县", label: "饶平县" },{value: "其他", label: "其他"}]},{value: "揭阳",label: "揭阳",children: [{value: "榕城区", label: "榕城区" },{value: "普宁市", label: "普宁市" },{value: "揭东县", label: "揭东县" },{value: "揭西县", label: "揭西县" },{value: "惠来县", label: "惠来县" },{value: "其他", label: "其他"}]},{value: "云浮",label: "云浮",children: [{value: "云城区", label: "云城区" },{value: "罗定市", label: "罗定市" },{value: "云安县", label: "云安县" },{value: "新兴县", label: "新兴县" },{value: "郁南县", label: "郁南县" },{value: "其他", label: "其他"}label: "其他"}]},{value: "上海",label: "上海",children: [{value: "黄浦区", label: "黄浦区"},{value: "卢湾区", label: "卢湾区"},{value: "徐汇区", label: "徐汇区"},{value: "长宁区", label: "长宁区"},{value: "静安区", label: "静安区"},{value: "普陀区", label: "普陀区"},{value: "闸北区", label: "闸北区"},{value: "虹⼝区", label: "虹⼝区"},{value: "杨浦区", label: "杨浦区"},{value: "宝⼭区", label: "宝⼭区"},{value: "闵⾏区", label: "闵⾏区"},{value: "嘉定区", label: "嘉定区"},{value: "松江区", label: "松江区"},{value: "⾦⼭区", label: "⾦⼭区"},{value: "青浦区", label: "青浦区"},{value: "南汇区", label: "南汇区"},{value: "奉贤区", label: "奉贤区"},{value: "浦东新区", label: "浦东新区" },{value: "其他", label: "其他"}]},{value: "天津",label: "天津",children: [{value: "和平区", label: "和平区" },{value: "河东区", label: "河东区" },{value: "河西区", label: "河西区" },{value: "南开区", label: "南开区" },{value: "河北区", label: "河北区" },{value: "红桥区", label: "红桥区" },{value: "塘沽区", label: "塘沽区" },{value: "汉沽区", label: "汉沽区" },{value: "⼤港区", label: "⼤港区" },{value: "东丽区", label: "东丽区" },{value: "西青区", label: "西青区" },{value: "北⾠区", label: "北⾠区" },{value: "津南区", label: "津南区" },{value: "武清区", label: "武清区" },{value: "宝坻区", label: "宝坻区" },{value: "静海县", label: "静海县" },{value: "宁河县", label: "宁河县" },{value: "蓟县",label: "其他"}]},{value: "重庆",label: "重庆",children: [{value: "渝中区", label: "渝中区"},{value: "⼤渡⼝区", label: "⼤渡⼝区" },{value: "江北区", label: "江北区"},{value: "南岸区", label: "南岸区"},{value: "北碚区", label: "北碚区"},{value: "渝北区", label: "渝北区"},{value: "巴南区", label: "巴南区"},{value: "长寿区", label: "长寿区"},{value: "双桥区", label: "双桥区"},{value: "沙坪坝区", label: "沙坪坝区" },{value: "万盛区", label: "万盛区"},{value: "万州区", label: "万州区"},{value: "涪陵区", label: "涪陵区"},{value: "黔江区", label: "黔江区"},{value: "永川区", label: "永川区"},{value: "合川区", label: "合川区"},{value: "江津区", label: "江津区"},{value: "九龙坡区", label: "九龙坡区" },{value: "潼南县",label: "潼南县"},{value: "荣昌县",label: "荣昌县"},{value: "璧⼭县",label: "璧⼭县"},{value: "⼤⾜县",label: "⼤⾜县"},{value: "铜梁县",label: "铜梁县"},{value: "梁平县",label: "梁平县"},{value: "开县",label: "开县"},{value: "忠县",label: "忠县"},{value: "城⼝县",label: "城⼝县"},{value: "垫江县",label: "垫江县"},{value: "武隆县",label: "武隆县"},{value: "丰都县",label: "丰都县"},{value: "奉节县",label: "奉节县"},{value: "云阳县",label: "云阳县"},{value: "巫溪县",label: "巫溪县"},{value: "巫⼭县",label: "巫⼭县"},{value: "⽯柱⼟家族⾃治县",label: "⽯柱⼟家族⾃治县"},{value: "秀⼭⼟家族苗族⾃治县", label: "秀⼭⼟家族苗族⾃治县" },{value: "⾣阳⼟家族苗族⾃治县", label: "⾣阳⼟家族苗族⾃治县" },]},{value: "辽宁",label: "辽宁",children: [{value: "沈阳",label: "沈阳",children: [{value: "沈河区", label: "沈河区"},{value: "皇姑区", label: "皇姑区"},{value: "和平区", label: "和平区"},{value: "⼤东区", label: "⼤东区"},{value: "铁西区", label: "铁西区"},{value: "苏家屯区", label: "苏家屯区" },{value: "东陵区", label: "东陵区"},{value: "于洪区", label: "于洪区"},{value: "新民市", label: "新民市"},{value: "法库县", label: "法库县"},{value: "辽中县", label: "辽中县"},{value: "康平县", label: "康平县"},{value: "新城⼦区", label: "新城⼦区" },{value: "其他",label: "其他"}]},{value: "⼤连",label: "⼤连",children: [{value: "西岗区", label: "西岗区"},{value: "⽢井⼦区",label: "⽢井⼦区"},{value: "旅顺⼝区",label: "旅顺⼝区"},{value: "⾦州区",label: "⾦州区"},{value: "⽡房店市",label: "⽡房店市"},{value: "普兰店市",label: "普兰店市"},{value: "庄河市",label: "庄河市"},{value: "长海县",label: "长海县"},{value: "其他",label: "其他"}]},{value: "鞍⼭",label: "鞍⼭",children: [{value: "铁东区",label: "铁东区"},{value: "铁西区",label: "铁西区"},{value: "⽴⼭区",label: "⽴⼭区"},{value: "千⼭区",label: "千⼭区"},{value: "海城市",label: "海城市"},{value: "台安县",label: "台安县"},{value: "岫岩满族⾃治县", label: "岫岩满族⾃治县" },{value: "其他",label: "其他"}]},{value: "抚顺",label: "抚顺",children: [{value: "东洲区",label: "东洲区"},{value: "望花区",label: "望花区"},{value: "抚顺县",label: "抚顺县"},{value: "清原满族⾃治县", label: "清原满族⾃治县" },{value: "新宾满族⾃治县", label: "新宾满族⾃治县" },{value: "其他",label: "其他"}]},{value: "本溪",label: "本溪",children: [{value: "平⼭区",label: "平⼭区"},{value: "明⼭区",label: "明⼭区"},{value: "溪湖区",label: "溪湖区"},{value: "南芬区",label: "南芬区"},{value: "本溪满族⾃治县", label: "本溪满族⾃治县" },{value: "桓仁满族⾃治县", label: "桓仁满族⾃治县" },{value: "其他",label: "其他"}]},{value: "丹东",label: "丹东",children: [{value: "振兴区",label: "振兴区"},{value: "元宝区",label: "元宝区"},{value: "振安区",label: "振安区"},{value: "宽甸满族⾃治县", label: "宽甸满族⾃治县" },{value: "其他",label: "其他"}]},{value: "锦州",label: "锦州",children: [{value: "太和区",label: "太和区"},{value: "古塔区",label: "古塔区"},{value: "凌河区",label: "凌河区"},{value: "凌海市",label: "凌海市"},{value: "⿊⼭县",label: "⿊⼭县"},{value: "义县",label: "义县"},{value: "北宁市",label: "北宁市"},{value: "其他",label: "其他"}]},{value: "营⼝",label: "营⼝",children: [{value: "站前区",label: "站前区"},{value: "西市区",label: "西市区"},{value: "鲅鱼圈区",label: "鲅鱼圈区"},{value: "⽼边区",label: "⽼边区"},{value: "⼤⽯桥市",label: "⼤⽯桥市"},{value: "盖州市",label: "盖州市"},},{value: "⾩新",label: "⾩新",children: [{value: "海州区",label: "海州区"},{value: "新邱区",label: "新邱区"},{value: "太平区",label: "太平区"},{value: "清河门区",label: "清河门区"},{value: "细河区",label: "细河区"},{value: "彰武县",label: "彰武县"},{value: "⾩新蒙古族⾃治县", label: "⾩新蒙古族⾃治县" },{value: "其他",label: "其他"}]},{value: "辽阳",label: "辽阳",children: [{value: "⽩塔区",label: "⽩塔区"},{value: "⽂圣区",label: "⽂圣区"},{value: "宏伟区",label: "宏伟区"},{value: "太⼦河区",label: "太⼦河区"},{value: "⼸长岭区",label: "⼸长岭区"},{value: "灯塔市",label: "灯塔市"},{value: "辽阳县",label: "辽阳县"},{value: "其他",label: "其他"}]},{value: "盘锦",label: "双台⼦区" },{value: "兴隆台区", label: "兴隆台区" },{value: "盘⼭县", label: "盘⼭县"},{value: "⼤洼县", label: "⼤洼县"},{value: "其他",label: "其他"}]},{value: "铁岭",label: "铁岭",children: [{value: "银州区", label: "银州区"},{value: "清河区", label: "清河区"},{value: "调兵⼭市", label: "调兵⼭市" },{value: "开原市", label: "开原市"},{value: "铁岭县", label: "铁岭县"},{value: "昌图县", label: "昌图县"},{value: "西丰县", label: "西丰县"},{value: "其他",label: "其他"}]},{value: "朝阳",label: "朝阳",children: [{value: "双塔区", label: "双塔区"},{value: "龙城区", label: "龙城区"},{value: "凌源市", label: "凌源市"},{value: "北票市", label: "北票市"},{value: "朝阳县",label: "建平县"},{value: "喀喇沁左翼蒙古族⾃治县", label: "喀喇沁左翼蒙古族⾃治县" },{value: "其他",label: "其他"}]},{value: "葫芦岛",label: "葫芦岛",children: [{value: "龙港区",label: "龙港区"},{value: "南票区",label: "南票区"},{value: "连⼭区",label: "连⼭区"},{value: "兴城市",label: "兴城市"},{value: "绥中县",label: "绥中县"},{value: "建昌县",label: "建昌县"},{value: "其他",label: "其他"}]},{value: "其他",label: "其他"}]},{value: "江苏",label: "江苏",children: [{value: "南京",label: "南京",children: [{value: "⽞武区",label: "⽞武区"},{value: "⽩下区",label: "⽩下区"},{value: "秦淮区",label: "秦淮区"},{value: "建邺区",label: "建邺区"},{value: "⿎楼区",label: "⿎楼区"},{value: "栖霞区", label: "栖霞区"},{value: "⾬花台区", label: "⾬花台区" },{value: "浦⼝区", label: "浦⼝区"},{value: "江宁区", label: "江宁区"},{value: "六合区", label: "六合区"},{value: "溧⽔县", label: "溧⽔县"},{value: "⾼淳县", label: "⾼淳县"},{value: "其他",label: "其他"}]},{value: "苏州",label: "苏州",children: [{value: "⾦阊区", label: "⾦阊区"},{value: "平江区", label: "平江区"},{value: "沧浪区", label: "沧浪区"},{value: "虎丘区", label: "虎丘区"},{value: "吴中区", label: "吴中区"},{value: "相城区", label: "相城区"},{value: "常熟市", label: "常熟市"},{value: "张家港市", label: "张家港市" },{value: "昆⼭市", label: "昆⼭市"},{value: "吴江市", label: "吴江市"},{value: "太仓市",。
省市县三级联动
Ajax+JS+Xml无刷新省市县三级联动(使用母版页,修改个人信息)前言:这是我第一次做省市县三级联动,所以体会很深就把我所遇到的情况给总结了一下,仅供大家参考!(其中,有许多资料是我从网上下载的。
)要想无刷新我们的配置ajax所以在web.config中添加ajax的配置:<system.web><httpHandlers><add verb="POST,GET"path="ajax/*.ashx"type="Ajax.PageHandlerFactory, Ajax" /> </httpHandlers></system.web>首先:我们在页面放三个DropDownList控件<asp:DropDownList ID="DropDownList1"runat="server"Height="20px"Width="60px"Font-Size="12px"></asp:DropDownList><asp:DropDownList ID="DropDownList2"runat="server"Height="20px"Width="60px"Font-Size="12px"></asp:DropDownList><asp:DropDownList ID="DropDownList3"runat="server"Height="20px"Width="60px"Font-Size="12px"></asp:DropDownList>然后再添加三个Lable控件,这是为了接收dropdownlist控件中的值<input id="lbl_provice_id"type="text"runat="server"style="display :none ;" name="lbl_provice_id"/><input id="lbl_provice"type="text"runat="server"style="DISPLAY: none"value=""/><input id="lbl_city"type="text"runat="server"style="DISPLAY: none"value=""/><input id="lbl_area"type="text"runat="server"style="DISPLAY: none"/>然后再在页面的源码中的page中添加enableEventValidation="false"这样就可以解决回调会回调函数无效这个错误。
中国省市分级JSON(附行政区编码)
中国城市列表JSON格式按省级分类
省市区三级联动
string sheng = context.Request.Form["Province"] == null ? "" : context.Request.Form["Province"]; string str = "select * from cities where provinceid='" + sheng + "'"; using (SqlDataAdapter ada = new SqlDataAdapter(str, conn)) {
$("#sheng").val("赋值"); GetShi();
$("#Shi").val("赋值"); GetQu(); $("@Qu").val("赋值"); }
})
function GetSheng() { $("#Sheng").empty(); $("#Sheng").append("<option value='0'>请选择</option>"); $.ajax({ type: "post", url: "GetJsonData.ashx", datatype: "josn", //数据类型 data: "type=GetProvince", async: false, //把异步改为同步 success: function (data) { var GetData = eval(data); //转一下型,GetData相当于一张表的模型了,打点就可以调用字段 $.each(GetData, function (i, item) { $("#Sheng").append("<option value='" + item.provinceid + "'>" + item.province + "</option>"); }) } }) GetShi();
JQuery+Json省市区三级联动
JQuery+Json省 市 区 三 级 联 动
一、画面以及JS
<!DOCTYPE html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>省市区三级联动[JSON+Jquery]</title> <!--<script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>--> <!--<script src="js/jquery-1.10.2.min.js"></script>--> <!--<script src="js/jquery-1.9.1.min.js"></script>--> <script src="js/jquery-1.8.0.min.js"></script> <script src="AraeDataJson/CityJson.js" type="text/javascript"></script> <script src="AraeDataJson/ProJson.js" type="text/javascript"></script> <script src="AraeDataJson/DistrictJson.js" type="text/javascript"></script> <script type="text/javascript">
记录地区三级联动查询
记录地区三级联动查询先是前台展⽰效果:点击省份时,城市和区域也变化点击城市时,区域发⽣变化代码:以新增地址作为例⼦1 @RequestMapping("/addAddress")2public String addAddress(HttpServletRequest request, ModelMap modelMap, HttpServletResponse response) {3//查出所有省份4 List<Map<String, Object>> provinceList = addressService.getAllRegion();5 modelMap.put("provinceList", provinceList);6return "wx/me/my_details_address_editor";7 }sql语句和数据库数据:<select id="getAllRegion" resultType="java.util.Map">select id as id, area_name as name from eb_area where level=1</select>查询出所有省份在前台页⾯展⽰,此时页⾯中只有省份可以选择前台代码:12 <form action="<%=basePath%>wx/me/saveAddress" method="POST" id="addAddressForm">3 <div class="myDtl_cnt_list">4 <div class="g-line g-clear">5 <h5 class="fl">姓名</h5>67 <div class="fr">8 <input class="myDtlIdy_input" style="" type="text" placeholder="请输⼊您的姓名" name="aName">9 </div>10 </div>11 <div class="g-line g-clear">12 <h5 class="fl">⼿机号码</h5>1314 <div class="fr">15 <input class="myDtlIdy_input" style="" type="text" placeholder="请输⼊您的⼿机号码" name="aPhone">16 </div>17 </div>18 <div class="g-line g-clear">19 <h5 class="fl">所在地区</h5>2021 <div class="fr">22 <label>23 <select style="line-height:1rem;height:2rem;width:5rem;border:none;" id="province2"24 name="provinceId">25 <option>选择省份</option>26 <c:forEach items="${provinceList}" var="province">27 <option value="${province.id}">${}</option>28 </c:forEach>29 <option>选择省份</option>30 </select>313233 <select style="line-height:1rem;height:2rem;width:5rem;border:none;" id="city2"34 name="cityId">35 <option value="">选择城市</option>36 </select>373839 <select style="line-height:1rem;height:2rem;width:5rem;border:none;" id="area2"40 name="areaId">41 <option value="">选择区域</option>42 </select>4344 </label>45 </div>46 </div>47 <label class="ml-row19 g-mt1">48 <textarea style="width:19rem;" name="aAddress" id="aAddress"></textarea>49 </label>50 </div>51 <div class="myDtlALL_ok"><a class="lgi_btn g-btn-crimson" href="javascript:void(0);"52 id="addAddress">保存</a></div>53 </form>54<script type="text/javascript">$("#addAddress").click(function () {$("#addAddressForm").submit();})//所在区域联动列表setup("province2", "city2", "area2");//下⾯有加载的js代码,定义⼀个通⽤⽅法,⽤于联动查询function setup(p, c, a) {$("#" + p + "").click(function () {province(p, c, a) //点击省份时联动查询省份,城市,区域⽅法});$("#" + c + "").click(function () {city(c, a); //点击城市的时候联动查询城市,区域的⽅法});}function province(p, c, a) {$.ajax({url: "<%=basePath%>wx/me/getCityByProvinceId?id=" + $("#" + p + "").val(),type: "POST",dataType: 'json',success: function (data) {$("#" + c + "").empty(); //清空下拉列表$.each($.parseJSON(data), function (i, json) { //$.parseJSON⽤于格式化json数据$("#" + c + "").append(" <option value='" + json.id + "'>" + + "</option>");//增加城市的数据 });city(c, a); }});}function city(c, a) {$.ajax({url: "<%=basePath%>wx/me/getAreaByCityId?id=" + $("#" + c + "").val(),type: "POST",dataType: 'json',success: function (data) {$("#" + a + "").empty(); //清空下拉列表$.each($.parseJSON(data), function (i, item) {$("#" + a + "").append(" <option value='" + item.id + "'>" + + "</option>");//增加区域的数据 });}});}</script>联动查询的后台代码:@RequestMapping("/getCityByProvinceId")@ResponseBodypublic String getCityByProvinceId(Integer id, HttpServletResponse response) {//根据省份id查询城市List<Map<String, Object>> cityList = addressService.getAllCitys(id);String json = JSON.toJSONString(cityList);return json;}@RequestMapping("/getAreaByCityId")@ResponseBodypublic String getAreaByCityId(Integer id, HttpServletResponse response) {//根据城市id查询地区List<Map<String, Object>> areaList = addressService.getAreaByCityId(id);String json = JSON.toJSONString(areaList);return json;}联动查询的sql语句:<select id="getAllCitys" resultType="java.util.Map" parameterType="ng.Integer">select id as id,area_name as name from eb_area where level=2 and parent_id =#{id} </select><select id="getAreaByCityId" resultType="java.util.Map" parameterType="ng.Integer"> select id as id,area_name as name from eb_area where level=3 and parent_id =#{id} </select>。
我写的全国省市县三级联动菜单,拿出来和大家分享了(原创)
我写的全国省市县三级联动菜单,拿出来和大家分享了(原创)$(function() { var areaPicker = newAreaPicker({provId:"province",cityId:"city",townId:"town",url :"ajax_search_area.jsp"}); areaPicker.pick(); selectid="province" /select select id="city" /select selectid="town" /select ajax页面(数据源) %@ page language="java"pageEncoding="UTF-8"% %@page import="java.sql.*"% private ic Connection conn; private static String driver ="com.mysql.jdbc.Driver"; // 数据库驱动 private static String ulr = "jdbc:mysql://172.16.1.115:3306/test"; private static String username = "root"; // 数据库的用户名 private static String = "root";// 数据库的密码 static { try{ Class.forName(driver); conn = DriverManager.getConnection(ulr, username, pwd);conn.AutoCommit(false); } ch (ClassNotFoundException e){ e.printStackTrace(); System.exit(-1); } catch (SQLException e) { e.printStackTrace(); System.exit(-1); //清除缓存 response.setHeader("Pragma","No-cache");response.setHeader("Cache-Control","no-cache");response.setDateHeader("Expires", 0); out.(); //接收参数 int level = -1; String levelStr = request.getParameter("level"); if(levelStr!=null levelStr.matches("^\\d+$")) level = Integer.parseInt(levelStr); String parentidStr =request.getParameter("parentid"); long parentid = -1;if(parentidStr!=null parentidStr.matches("^\\d+$"))parentid = Long.parseLong(parentidStr); //查询数据 if(level 0 parentid 0) return; if(level =0 parentid 0) { String sql ="select id,name from china_area where level=? order by id asc;"; PreparStatement ps = conn.prepareStatement(sql); ps.setInt(1, level); ResultSet rs = ps.exeeQuery(); StringBuffer sb = new StringBuffer(); while (rs.next()){ sb.append(";"+rs.getLong("id")+","+rs.getString("name")); rs.close(); ps.close(); if(sb.length() 0) sb.delete(0, 1); out.print(sb.toString()); if(level 0 parentid =0) { String sql = "select id,name from china_area where parentid=? order by id asc;"; PreparedStatement ps = conn.prepareStatement(sql); ps.setLong(1, parentid); ResultSet rs = ps.executeQuery(); StringBuffer sb = new StringBuffer(); while (rs.next()){ sb.append(";"+rs.getLong("id")+","+rs.getString("name")); rs.close(); ps.close(); if(sb.length() 0) sb.delete(0, 1); out.print(sb.toString()); if(level =0 parentid =0) { String sql = "select id,name from china_area where level=? and parentid=? order by id asc;"; PreparedStatement ps =conn.prepareStatement(sql); ps.setInt(1, level);ps.setLong(2, parentid); ResultSet rs = ps.executeQuery(); StringBuffer sb = new StringBuffer(); while (rs.next()){ sb.append(";"+rs.getLong("id")+","+rs.getString("name")); rs.close(); ps.close(); if(sb.length() 0) sb.delete(0, 1); out.print(sb.toString());。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2016年中国省市区三级联的JSON格式{"北京市":{"name":"北京市","data":{"北京市":{"name":"北京市","data":{"东城区":{"name":"东城区"},"西城区":{"name":"西城区"},"朝阳区":{"name":"朝阳区"},"丰台区":{"name":"丰台区"},"石景山区":{"name":"石景山区"},"海淀区":{"name":"海淀区"},"门头沟区":{"name":"门头沟区"},"房山区":{"name":"房山区"},"通州区":{"name":"通州区"},"顺义区":{"name":"顺义区"},"昌平区":{"name":"昌平区"},"大兴区":{"name":"大兴区"},"怀柔区":{"name":"怀柔区"},"平谷区":{"name":"平谷区"},"密云县":{"name":"密云县"},"延庆县":{"name":"延庆县"}}}}},"天津市":{"name":"天津市","data":{"天津市":{"name":"天津市","data":{"和平区":{"name":"和平区"},"河东区":{"name":"河东区"},"河西区":{"name":"河西区"},"南开区":{"name":"南开区"},"河北区":{"name":"河北区"},"红桥区":{"name":"红桥区"},"东丽区":{"name":"东丽区"},"西青区":{"name":"西青区"},"津南区":{"name":"津南区"},"北辰区":{"name":"北辰区"},"武清区":{"name":"武清区"},"宝坻区":{"name":"宝坻区"},"滨海新区":{"name":"滨海新区"},"宁河县":{"name":"宁河县"},"静海县":{"name":"静海县"},"蓟县":{"name":"蓟县"}}}}},"河北省":{"name":"河北省","data":{"石家庄市":{"name":"石家庄市","data":{"长安区":{"name":"长安区"},"桥东区":{"name":"桥东区"},"桥西区":{"name":"桥西区"},"新华区":{"name":"新华区"},"井陉矿区":{"name":"井陉矿区"},"裕华区":{"name":"裕华区"},"井陉县":{"name":"井陉县"},"正定县":{"name":"正定县"},"栾城县":{"name":"栾城县"},"行唐县":{"name":"行唐县"},"灵寿县":{"name":"灵寿县"},"高邑县":{"name":"高邑县"},"深泽县":{"name":"深泽县"},"赞皇县":{"name":"赞皇县"},"无极县":{"name":"无极县"},"平山县":{"name":"平山县"},"元氏县":{"name":"元氏县"},"赵县":{"name":"赵县"},"辛集市":{"name":"辛集市"},"藁城市":{"name":"藁城市"},"晋州市":{"name":"晋州市"},"新乐市":{"name":"新乐市"},"鹿泉市":{"name":"鹿泉市"}}},"唐山市":{"name":"唐山市","data":{"路南区":{"name":"路南区"},"路北区":{"name":"路北区"},"古冶区":{"name":"古冶区"},"开平区":{"name":"开平区"},"丰南区":{"name":"丰南区"},"丰润区":{"name":"丰润区"},"滦县":{"name":"滦县"},"滦南县":{"name":"滦南县"},"乐亭县":{"name":"乐亭县"},"迁西县":{"name":"迁西县"},"玉田县":{"name":"玉田县"},"曹妃甸区":{"name":"曹妃甸区"},"遵化市":{"name":"遵化市"},"迁安市":{"name":"迁安市"}}},"秦皇岛市":{"name":"秦皇岛市","data":{"海港区":{"name":"海港区"},"山海关区":{"name":"山海关区"},"北戴河区":{"name":"北戴河区"},"青龙满族自治县":{"name":"青龙满族自治县"},"昌黎县":{"name":"昌黎县"},"抚宁县":{"name":"抚宁县"},"卢龙县":{"name":"卢龙县"}}},"邯郸市":{"name":"邯郸市","data":{"邯山区":{"name":"邯山区"},"丛台区":{"name":"丛台区"},"复兴区":{"name":"复兴区"},"峰峰矿区":{"name":"峰峰矿区"},"邯郸县":{"name":"邯郸县"},"临漳县":{"name":"临漳县"},"成安县":{"name":"成安县"},"大名县":{"name":"大名县"},"涉县":{"name":"涉县"},"磁县":{"name":"磁县"},"肥乡县":{"name":"肥乡县"},"永年县":{"name":"永年县"},"邱县":{"name":"邱县"},"鸡泽县":{"name":"鸡泽县"},"广平县":{"name":"广平县"},"馆陶县":{"name":"馆陶县"},"魏县":{"name":"魏县"},"曲周县":{"name":"曲周县"},"武安市":{"name":"武安市"}}},"邢台市":{"name":"邢台市","data":{"桥东区":{"name":"桥东区"},"桥西区":{"name":"桥西区"},"邢台县":{"name":"邢台县"},"临城县":{"name":"临城县"},"内丘县":{"name":"内丘县"},"柏乡县":{"name":"柏乡县"},"隆尧县":{"name":"隆尧县"},"任县":{"name":"任县"},"南和县":{"name":"南和县"},"宁晋县":{"name":"宁晋县"},"巨鹿县":{"name":"巨鹿县"},"新河县":{"name":"新河县"},"广宗县":{"name":"广宗县"},"平乡县":{"name":"平乡县"},"威县":{"name":"威县"},"清河县":{"name":"清河县"},"临西县":{"name":"临西县"},"南宫市":{"name":"南宫市"},"沙河市":{"name":"沙河市"}}},"保定市":{"name":"保定市","data":{"新市区":{"name":"新市区"},"北市区":{"name":"北市区"},"南市区":{"name":"南市区"},"满城县":{"name":"满城县"},"清苑县":{"name":"清苑县"},"涞水县":{"name":"涞水县"},"阜平县":{"name":"阜平县"},"徐水县":{"name":"徐水县"},"定兴县":{"name":"定兴县"},"唐县":{"name":"唐县"},"高阳县":{"name":"高阳县"},"容城县":{"name":"容城县"},"涞源县":{"name":"涞源县"},"望都县":{"name":"望都县"},"安新县":{"name":"安新县"},"易县":{"name":"易县"},"曲阳县":{"name":"曲阳县"},"蠡县":{"name":"蠡县"},"顺平县":{"name":"顺平县"},"博野县":{"name":"博野县"},"雄县":{"name":"雄县"},"涿州市":{"name":"涿州市"},"定州市":{"name":"定州市"},"安国市":{"name":"安国市"},"高碑店市":{"name":"高碑店市"}}},"张家口市":{"name":"张家口市","data":{"桥东区":{"name":"桥东区"},"桥西区":{"name":"桥西区"},"宣化区":{"name":"宣化区"},"下花园区":{"name":"下花园区"},"宣化县":{"name":"宣化县"},"张北县":{"name":"张北县"},"康保县":{"name":"康保县"},"沽源县":{"name":"沽源县"},"尚义县":{"name":"尚义县"},"蔚县":{"name":"蔚县"},"阳原县":{"name":"阳原县"},"怀安县":{"name":"怀安县"},"万全县":{"name":"万全县"},"怀来县":{"name":"怀来县"},"涿鹿县":{"name":"涿鹿县"},"赤城县":{"name":"赤城县"},"崇礼县":{"name":"崇礼县"}}},"承德市":{"name":"承德市","data":{"双桥区":{"name":"双桥区"},"双滦区":{"name":"双滦区"},"鹰手营子矿区":{"name":"鹰手营子矿区"},"承德县":{"name":"承德县"},"兴隆县":{"name":"兴隆县"},"平泉县":{"name":"平泉县"},"滦平县":{"name":"滦平县"},"隆化县":{"name":"隆化县"},"丰宁满族自治县":{"name":"丰宁满族自治县"},"宽城满族自治县":{"name":"宽城满族自治县"},"围场满族蒙古族自治县":{"name":"围场满族蒙古族自治县"}}},"沧州市":{"name":"沧州市","data":{"新华区":{"name":"新华区"},"运河区":{"name":"运河区"},"沧县":{"name":"沧县"},"青县":{"name":"青县"},"东光县":{"name":"东光县"},"海兴县":{"name":"海兴县"},"盐山县":{"name":"盐山县"},"肃宁县":{"name":"肃宁县"},"南皮县":{"name":"南皮县"},"吴桥县":{"name":"吴桥县"},"献县":{"name":"献县"},"孟村回族自治县":{"name":"孟村回族自治县"},"泊头市":{"name":"泊头市"},"任丘市":{"name":"任丘市"},"黄骅市":{"name":"黄骅市"},"河间市":{"name":"河间市"}}},"廊坊市":{"name":"廊坊市","data":{"安次区":{"name":"安次区"},"广阳区":{"name":"广阳区"},"固安县":{"name":"固安县"},"永清县":{"name":"永清县"},"香河县":{"name":"香河县"},"大城县":{"name":"大城县"},"文安县":{"name":"文安县"},"大厂回族自治县":{"name":"大厂回族自治县"},"霸州市":{"name":"霸州市"},"三河市":{"name":"三河市"}}},"衡水市":{"name":"衡水市","data":{"桃城区":{"name":"桃城区"},"枣强县":{"name":"枣强县"},"武邑县":{"name":"武邑县"},"武强县":{"name":"武强县"},"饶阳县":{"name":"饶阳县"},"安平县":{"name":"安平县"},"故城县":{"name":"故城县"},"景县":{"name":"景县"},"阜城县":{"name":"阜城县"},"冀州市":{"name":"冀州市"},"深州市":{"name":"深州市"}}}}},"山西省":{"name":"山西省","data":{"太原市":{"name":"太原市","data":{"小店区":{"name":"小店区"},"迎泽区":{"name":"迎泽区"},"杏花岭区":{"name":"杏花岭区"},"尖草坪区":{"name":"尖草坪区"},"万柏林区":{"name":"万柏林区"},"晋源区":{"name":"晋源区"},"清徐县":{"name":"清徐县"},"阳曲县":{"name":"阳曲县"},"娄烦县":{"name":"娄烦县"},"古交市":{"name":"古交市"}}},"大同市":{"name":"大同市","data":{"城区":{"name":"城区"},"矿区":{"name":"矿区"},"南郊区":{"name":"南郊区"},"新荣区":{"name":"新荣区"},"阳高县":{"name":"阳高县"},"天镇县":{"name":"天镇县"},"广灵县":{"name":"广灵县"},"灵丘县":{"name":"灵丘县"},"浑源县":{"name":"浑源县"},"左云县":{"name":"左云县"},"大同县":{"name":"大同县"}}},"阳泉市":{"name":"阳泉市","data":{"城区":{"name":"城区"},"矿区":{"name":"矿区"},"郊区":{"name":"郊区"},"平定县":{"name":"平定县"},"盂县":{"name":"盂县"}}},"长治市":{"name":"长治市","data":{"城区":{"name":"城区"},"郊区":{"name":"郊区"},"长治县":{"name":"长治县"},"襄垣县":{"name":"襄垣县"},"屯留县":{"name":"屯留县"},"平顺县":{"name":"平顺县"},"黎城县":{"name":"黎城县"},"壶关县":{"name":"壶关县"},"长子县":{"name":"长子县"},"武乡县":{"name":"武乡县"},"沁县":{"name":"沁县"},"沁源县":{"name":"沁源县"},"潞城市":{"name":"潞城市"}}},"晋城市":{"name":"晋城市","data":{"城区":{"name":"城区"},"沁水县":{"name":"沁水县"},"阳城县":{"name":"阳城县"},"陵川县":{"name":"陵川县"},"泽州县":{"name":"泽州县"},"高平市":{"name":"高平市"}}},"朔州市":{"name":"朔州市","data":{"朔城区":{"name":"朔城区"},"平鲁区":{"name":"平鲁区"},"山阴县":{"name":"山阴县"},"应县":{"name":"应县"},"右玉县":{"name":"右玉县"},"怀仁县":{"name":"怀仁县"}}},"晋中市":{"name":"晋中市","data":{"榆次区":{"name":"榆次区"},"榆社县":{"name":"榆社县"},"左权县":{"name":"左权县"},"和顺县":{"name":"和顺县"},"昔阳县":{"name":"昔阳县"},"寿阳县":{"name":"寿阳县"},"太谷县":{"name":"太谷县"},"祁县":{"name":"祁县"},"平遥县":{"name":"平遥县"},"灵石县":{"name":"灵石县"},"介休市":{"name":"介休市"}}},"运城市":{"name":"运城市","data":{"盐湖区":{"name":"盐湖区"},"临猗县":{"name":"临猗县"},"万荣县":{"name":"万荣县"},"闻喜县":{"name":"闻喜县"},"稷山县":{"name":"稷山县"},"新绛县":{"name":"新绛县"},"绛县":{"name":"绛县"},"垣曲县":{"name":"垣曲县"},"夏县":{"name":"夏县"},"平陆县":{"name":"平陆县"},"芮城县":{"name":"芮城县"},"永济市":{"name":"永济市"},"河津市":{"name":"河津市"}}},"忻州市":{"name":"忻州市","data":{"忻府区":{"name":"忻府区"},"定襄县":{"name":"定襄县"},"五台县":{"name":"五台县"},"代县":{"name":"代县"},"繁峙县":{"name":"繁峙县"},"宁武县":{"name":"宁武县"},"静乐县":{"name":"静乐县"},"神池县":{"name":"神池县"},"五寨县":{"name":"五寨县"},"岢岚县":{"name":"岢岚县"},"河曲县":{"name":"河曲县"},"保德县":{"name":"保德县"},"偏关县":{"name":"偏关县"},"原平市":{"name":"原平市"}}},"临汾市":{"name":"临汾市","data":{"尧都区":{"name":"尧都区"},"曲沃县":{"name":"曲沃县"},"翼城县":{"name":"翼城县"},"襄汾县":{"name":"襄汾县"},"洪洞县":{"name":"洪洞县"},"古县":{"name":"古县"},"安泽县":{"name":"安泽县"},"浮山县":{"name":"浮山县"},"吉县":{"name":"吉县"},"乡宁县":{"name":"乡宁县"},"大宁县":{"name":"大宁县"},"隰县":{"name":"隰县"},"永和县":{"name":"永和县"},"蒲县":{"name":"蒲县"},"汾西县":{"name":"汾西县"},"侯马市":{"name":"侯马市"},"霍州市":{"name":"霍州市"}}},"吕梁市":{"name":"吕梁市","data":{"离石区":{"name":"离石区"},"文水县":{"name":"文水县"},"交城县":{"name":"交城县"},"兴县":{"name":"兴县"},"临县":{"name":"临县"},"柳林县":{"name":"柳林县"},"石楼县":{"name":"石楼县"},"岚县":{"name":"岚县"},"方山县":{"name":"方山县"},"中阳县":{"name":"中阳县"},"交口县":{"name":"交口县"},"孝义市":{"name":"孝义市"},"汾阳市":{"name":"汾阳市"}}}}},"内蒙古自治区":{"name":"内蒙古自治区","data":{"呼和浩特市":{"name":"呼和浩特市","data":{"新城区":{"name":"新城区"},"回民区":{"name":"回民区"},"玉泉区":{"name":"玉泉区"},"赛罕区":{"name":"赛罕区"},"土默特左旗":{"name":"土默特左旗"},"托克托县":{"name":"托克托县"},"和林格尔县":{"name":"和林格尔县"},"清水河县":{"name":"清水河县"},"武川县":{"name":"武川县"}}},"包头市":{"name":"包头市","data":{"东河区":{"name":"东河区"},"昆都仑区":{"name":"昆都仑区"},"青山区":{"name":"青山区"},"石拐区":{"name":"石拐区"},"白云鄂博矿区":{"name":"白云鄂博矿区"},"九原区":{"name":"九原区"},"土默特右旗":{"name":"土默特右旗"},"固阳县":{"name":"固阳县"},"达尔罕茂明安联合旗":{"name":"达尔罕茂明安联合旗"}}},"乌海市":{"name":"乌海市","data":{"海勃湾区":{"name":"海勃湾区"},"海南区":{"name":"海南区"},"乌达区":{"name":"乌达区"}}},"赤峰市":{"name":"赤峰市","data":{"红山区":{"name":"红山区"},"元宝山区":{"name":"元宝山区"},"松山区":{"name":"松山区"},"阿鲁科尔沁旗":{"name":"阿鲁科尔沁旗"},"巴林左旗":{"name":"巴林左旗"},"巴林右旗":{"name":"巴林右旗"},"林西县":{"name":"林西县"},"克什克腾旗":{"name":"克什克腾旗"},"翁牛特旗":{"name":"翁牛特旗"},"喀喇沁旗":{"name":"喀喇沁旗"},"宁城县":{"name":"宁城县"},"敖汉旗":{"name":"敖汉旗"}}},"通辽市":{"name":"通辽市","data":{"科尔沁区":{"name":"科尔沁区"},"科尔沁左翼中旗":{"name":"科尔沁左翼中旗"},"科尔沁左翼后旗":{"name":"科尔沁左翼后旗"},"开鲁县":{"name":"开鲁县"},"库伦旗":{"name":"库伦旗"},"奈曼旗":{"name":"奈曼旗"},"扎鲁特旗":{"name":"扎鲁特旗"},"霍林郭勒市":{"name":"霍林郭勒市"}}},"鄂尔多斯市":{"name":"鄂尔多斯市","data":{"东胜区":{"name":"东胜区"},"达拉特旗":{"name":"达拉特旗"},"准格尔旗":{"name":"准格尔旗"},"鄂托克前旗":{"name":"鄂托克前旗"},"鄂托克旗":{"name":"鄂托克旗"},"杭锦旗":{"name":"杭锦旗"},"乌审旗":{"name":"乌审旗"},"伊金霍洛旗":{"name":"伊金霍洛旗"}}},"呼伦贝尔市":{"name":"呼伦贝尔市","data":{"海拉尔区":{"name":"海拉尔区"},"阿荣旗":{"name":"阿荣旗"},"莫力达瓦达斡尔族自治旗":{"name":"莫力达瓦达斡尔族自治旗"},"鄂伦春自治旗":{"name":"鄂伦春自治旗"},"鄂温克族自治旗":{"name":"鄂温克族自治旗"},"陈巴尔虎旗":{"name":"陈巴尔虎旗"},"新巴尔虎左旗":{"name":"新巴尔虎左旗"},"新巴尔虎右旗":{"name":"新巴尔虎右旗"},"满洲里市":{"name":"满洲里市"},"牙克石市":{"name":"牙克石市"},"扎兰屯市":{"name":"扎兰屯市"},"额尔古纳市":{"name":"额尔古纳市"},"根河市":{"name":"根河市"}}},"巴彦淖尔市":{"name":"巴彦淖尔市","data":{"临河区":{"name":"临河区"},"五原县":{"name":"五原县"},"磴口县":{"name":"磴口县"},"乌拉特前旗":{"name":"乌拉特前旗"},"乌拉特中旗":{"name":"乌拉特中旗"},"乌拉特后旗":{"name":"乌拉特后旗"},"杭锦后旗":{"name":"杭锦后旗"}}},"乌兰察布市":{"name":"乌兰察布市","data":{"集宁区":{"name":"集宁区"},"卓资县":{"name":"卓资县"},"化德县":{"name":"化德县"},"商都县":{"name":"商都县"},"兴和县":{"name":"兴和县"},"凉城县":{"name":"凉城县"},"察哈尔右翼前旗":{"name":"察哈尔右翼前旗"},"察哈尔右翼中旗":{"name":"察哈尔右翼中旗"},"察哈尔右翼后旗":{"name":"察哈尔右翼后旗"},"四子王旗":{"name":"四子王旗"},"丰镇市":{"name":"丰镇市"}}},"兴安盟":{"name":"兴安盟","data":{"乌兰浩特市":{"name":"乌兰浩特市"},"阿尔山市":{"name":"阿尔山市"},"科尔沁右翼前旗":{"name":"科尔沁右翼前旗"},"科尔沁右翼中旗":{"name":"科尔沁右翼中旗"},"扎赉特旗":{"name":"扎赉特旗"},"突泉县":{"name":"突泉县"}}},"锡林郭勒盟":{"name":"锡林郭勒盟","data":{"二连浩特市":{"name":"二连浩特市"},"锡林浩特市":{"name":"锡林浩特市"},"阿巴嘎旗":{"name":"阿巴嘎旗"},"苏尼特左旗":{"name":"苏尼特左旗"},"苏尼特右旗":{"name":"苏尼特右旗"},"东乌珠穆沁旗":{"name":"东乌珠穆沁旗"},"西乌珠穆沁旗":{"name":"西乌珠穆沁旗"},"太仆寺旗":{"name":"太仆寺旗"},"镶黄旗":{"name":"镶黄旗"},"正镶白旗":{"name":"正镶白旗"},"正蓝旗":{"name":"正蓝旗"},"多伦县":{"name":"多伦县"}}},"阿拉善盟":{"name":"阿拉善盟","data":{"阿拉善左旗":{"name":"阿拉善左旗"},"阿拉善右旗":{"name":"阿拉善右旗"},"额济纳旗":{"name":"额济纳旗"}}}}},"辽宁省":{"name":"辽宁省","data":{"沈阳市":{"name":"沈阳市","data":{"和平区":{"name":"和平区"},"沈河区":{"name":"沈河区"},"大东区":{"name":"大东区"},"皇姑区":{"name":"皇姑区"},"铁西区":{"name":"铁西区"},"苏家屯区":{"name":"苏家屯区"},"东陵区":{"name":"东陵区"},"沈北新区":{"name":"沈北新区"},"于洪区":{"name":"于洪区"},"辽中县":{"name":"辽中县"},"康平县":{"name":"康平县"},"法库县":{"name":"法库县"},"新民市":{"name":"新民市"}}},"大连市":{"name":"大连市","data":{"中山区":{"name":"中山区"},"西岗区":{"name":"西岗区"},"沙河口区":{"name":"沙河口区"},"甘井子区":{"name":"甘井子区"},"旅顺口区":{"name":"旅顺口区"},"金州区":{"name":"金州区"},"长海县":{"name":"长海县"},"瓦房店市":{"name":"瓦房店市"},"普兰店市":{"name":"普兰店市"},"庄河市":{"name":"庄河市"}}},"鞍山市":{"name":"鞍山市","data":{"铁东区":{"name":"铁东区"},"铁西区":{"name":"铁西区"},"立山区":{"name":"立山区"},"千山区":{"name":"千山区"},"台安县":{"name":"台安县"},"岫岩满族自治县":{"name":"岫岩满族自治县"},"海城市":{"name":"海城市"}}},"抚顺市":{"name":"抚顺市","data":{"新抚区":{"name":"新抚区"},"东洲区":{"name":"东洲区"},"望花区":{"name":"望花区"},"顺城区。