常用js-API
jquery.base64.js
//下面是64个基本的编码 var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var base64DecodeChars = new Array( -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1); //编码的方法 function base64encode(str) { var out, i, len; var c1, c2, c3; len = str.length; i = 0; out = ""; while (i < len) { c1 = str.charCodeAt(i++) & 0xff; if (i == len) { out += base64EncodeChars.charAt(c1 >> 2); out += base64EncodeChars.charAt((c1 & 0x3) << 4); out += "=="; break; } c2 = str.charCodeAt(i++); if (i == len) { out += base64EncodeChars.charAt(c1 >> 2); out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4)); out += base64EncodeChars.charAt((c2 & 0xF) << 2); out += "="; break; } c3 = str.charCodeAt(i++); out += base64EncodeChars.charAt(c1 >> 2); out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4)); out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6)); out += base64EncodeChars.charAt(c3 & 0x3F); } return out; } //解码的方法 function base64decode(str) { var c1, c2, c3, c4; var i, len, out; len = str.length; i = 0; out = ""; while (i < len) { do { c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff]; } while (i < len && c1 == -1); if (c1 == -1) break; do { c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff]; } while (i < len && c2 == -1); if (c2 == -1) break; out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4)); do { c3 = str.charCodeAt(i++) & 0xff; if (c3 == 61) return out; c3 = base64DecodeChars[c3]; } while (i < len && c3 == -1); if (c3 == -1) break; out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2)); do { c4 = str.charCodeAt(i++) & 0xff; if (c4 == 61) return out; c4 = base64DecodeChars[c4]; } while (i < len && c4 == -1); if (c4 == -1) break; out += String.fromCharCode(((c3 & 0x03) << 6) | c4); } return out; } function utf16to8(str) { var out, i, len, c; out = ""; len = str.length; for (i = 0; i < len; i++) { c = str.charCodeAt(i); if ((c >= 0x0001) && (c <= 0x007F)) { out += str.charAt(i); } else if (c > 0x07FF) { out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); } else { out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); } } return out; } function utf8to16(str) { var out, i, len, c; var char2, char3; out = ""; len = str.length; i = 0; while (i < len) { c = str.charCodeAt(i++); switch (c >> 4) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: // 0xxxxxxx out += str.charAt(i - 1); break; case 12: case 13: // 110x xxxx 10xx xxxx char2 = str.charCodeAt(i++); out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F)); break; case 14: // 1110 xxxx 10xx xxxx 10xx xxxx char2 = str.charCodeAt(i++); char3 = str.charCodeAt(i++); out += String.fromCharCode(((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0)); break; } } return out; } function base64decodeCN(str) { return utf8to16(base64decode(str)) } function base64encodeCN(str) { return base64encode(utf16to8(str)); } //编码 //value = base64encode(utf16to8(src)) //解码 //value = utf8to16(base64decode(src))
PCJSON.js 获取省市数据
window.PCData =[ { "code": "110000", "name": "北京市", "pid": "0" }, { "code": "110100", "name": "北京市", "pid": "110000" }, { "code": "120000", "name": "天津市", "pid": "0" }, { "code": "120100", "name": "天津市", "pid": "120000" }, { "code": "130000", "name": "河北省", "pid": "0" }, { "code": "130100", "name": "石家庄市", "pid": "130000" }, { "code": "130200", "name": "唐山市", "pid": "130000" }, { "code": "130300", "name": "秦皇岛市", "pid": "130000" }, { "code": "130400", "name": "邯郸市", "pid": "130000" }, { "code": "130500", "name": "邢台市", "pid": "130000" }, { "code": "130600", "name": "保定市", "pid": "130000" }, { "code": "130700", "name": "张家口市", "pid": "130000" }, { "code": "130800", "name": "承德市", "pid": "130000" }, { "code": "130900", "name": "沧州市", "pid": "130000" }, { "code": "131000", "name": "廊坊市", "pid": "130000" }, { "code": "131100", "name": "衡水市", "pid": "130000" }, { "code": "140000", "name": "山西省", "pid": "0" }, { "code": "140100", "name": "太原市", "pid": "140000" }, { "code": "140200", "name": "大同市", "pid": "140000" }, { "code": "140300", "name": "阳泉市", "pid": "140000" }, { "code": "140400", "name": "长治市", "pid": "140000" }, { "code": "140500", "name": "晋城市", "pid": "140000" }, { "code": "140600", "name": "朔州市", "pid": "140000" }, { "code": "140700", "name": "晋中市", "pid": "140000" }, { "code": "140800", "name": "运城市", "pid": "140000" }, { "code": "140900", "name": "忻州市", "pid": "140000" }, { "code": "141000", "name": "临汾市", "pid": "140000" }, { "code": "141100", "name": "吕梁市", "pid": "140000" }, { "code": "150000", "name": "内蒙古", "pid": "0" }, { "code": "150100", "name": "呼和浩特市", "pid": "150000" }, { "code": "150200", "name": "包头市", "pid": "150000" }, { "code": "150300", "name": "乌海市", "pid": "150000" }, { "code": "150400", "name": "赤峰市", "pid": "150000" }, { "code": "150500", "name": "通辽市", "pid": "150000" }, { "code": "150600", "name": "鄂尔多斯市", "pid": "150000" }, { "code": "150700", "name": "呼伦贝尔市", "pid": "150000" }, { "code": "150800", "name": "巴彦淖尔市", "pid": "150000" }, { "code": "150900", "name": "乌兰察布市", "pid": "150000" }, { "code": "152200", "name": "兴安盟", "pid": "150000" }, { "code": "152500", "name": "锡林郭勒盟", "pid": "150000" }, { "code": "152900", "name": "阿拉善盟", "pid": "150000" }, { "code": "210000", "name": "辽宁省", "pid": "0" }, { "code": "210100", "name": "沈阳市", "pid": "210000" }, { "code": "210200", "name": "大连市", "pid": "210000" }, { "code": "210300", "name": "鞍山市", "pid": "210000" }, { "code": "210400", "name": "抚顺市", "pid": "210000" }, { "code": "210500", "name": "本溪市", "pid": "210000" }, { "code": "210600", "name": "丹东市", "pid": "210000" }, { "code": "210700", "name": "锦州市", "pid": "210000" }, { "code": "210800", "name": "营口市", "pid": "210000" }, { "code": "210900", "name": "阜新市", "pid": "210000" }, { "code": "211000", "name": "辽阳市", "pid": "210000" }, { "code": "211100", "name": "盘锦市", "pid": "210000" }, { "code": "211200", "name": "铁岭市", "pid": "210000" }, { "code": "211300", "name": "朝阳市", "pid": "210000" }, { "code": "211400", "name": "葫芦岛市", "pid": "210000" }, { "code": "220000", "name": "吉林省", "pid": "0" }, { "code": "220100", "name": "长春市", "pid": "220000" }, { "code": "220200", "name": "吉林市", "pid": "220000" }, { "code": "220300", "name": "四平市", "pid": "220000" }, { "code": "220400", "name": "辽源市", "pid": "220000" }, { "code": "220500", "name": "通化市", "pid": "220000" }, { "code": "220600", "name": "白山市", "pid": "220000" }, { "code": "220700", "name": "松原市", "pid": "220000" }, { "code": "220800", "name": "白城市", "pid": "220000" }, { "code": "222400", "name": "延边州", "pid": "220000" }, { "code": "230000", "name": "黑龙江省", "pid": "0" }, { "code": "230100", "name": "哈尔滨市", "pid": "230000" }, { "code": "230200", "name": "齐齐哈尔市", "pid": "230000" }, { "code": "230300", "name": "鸡西市", "pid": "230000" }, { "code": "230400", "name": "鹤岗市", "pid": "230000" }, { "code": "230500", "name": "双鸭山市", "pid": "230000" }, { "code": "230600", "name": "大庆市", "pid": "230000" }, { "code": "230700", "name": "伊春市", "pid": "230000" }, { "code": "230800", "name": "佳木斯市", "pid": "230000" }, { "code": "230900", "name": "七台河市", "pid": "230000" }, { "code": "231000", "name": "牡丹江市", "pid": "230000" }, { "code": "231100", "name": "黑河市", "pid": "230000" }, { "code": "231200", "name": "绥化市", "pid": "230000" }, { "code": "232700", "name": "大兴安岭地区", "pid": "230000" }, { "code": "310000", "name": "上海市", "pid": "0" }, { "code": "310100", "name": "上海市", "pid": "310000" }, { "code": "320000", "name": "江苏省", "pid": "0" }, { "code": "320100", "name": "南京市", "pid": "320000" }, { "code": "320200", "name": "无锡市", "pid": "320000" }, { "code": "320300", "name": "徐州市", "pid": "320000" }, { "code": "320400", "name": "常州市", "pid": "320000" }, { "code": "320500", "name": "苏州市", "pid": "320000" }, { "code": "320600", "name": "南通市", "pid": "320000" }, { "code": "320700", "name": "连云港市", "pid": "320000" }, { "code": "320800", "name": "淮安市", "pid": "320000" }, { "code": "320900", "name": "盐城市", "pid": "320000" }, { "code": "321000", "name": "扬州市", "pid": "320000" }, { "code": "321100", "name": "镇江市", "pid": "320000" }, { "code": "321200", "name": "泰州市", "pid": "320000" }, { "code": "321300", "name": "宿迁市", "pid": "320000" }, { "code": "330000", "name": "浙江省", "pid": "0" }, { "code": "330100", "name": "杭州市", "pid": "330000" }, { "code": "330200", "name": "宁波市", "pid": "330000" }, { "code": "330300", "name": "温州市", "pid": "330000" }, { "code": "330400", "name": "嘉兴市", "pid": "330000" }, { "code": "330500", "name": "湖州市", "pid": "330000" }, { "code": "330600", "name": "绍兴市", "pid": "330000" }, { "code": "330700", "name": "金华市", "pid": "330000" }, { "code": "330800", "name": "衢州市", "pid": "330000" }, { "code": "330900", "name": "舟山市", "pid": "330000" }, { "code": "331000", "name": "台州市", "pid": "330000" }, { "code": "331100", "name": "丽水市", "pid": "330000" }, { "code": "340000", "name": "安徽省", "pid": "0" }, { "code": "340100", "name": "合肥市", "pid": "340000" }, { "code": "340200", "name": "芜湖市", "pid": "340000" }, { "code": "340300", "name": "蚌埠市", "pid": "340000" }, { "code": "340400", "name": "淮南市", "pid": "340000" }, { "code": "340500", "name": "马鞍山市", "pid": "340000" }, { "code": "340600", "name": "淮北市", "pid": "340000" }, { "code": "340700", "name": "铜陵市", "pid": "340000" }, { "code": "340800", "name": "安庆市", "pid": "340000" }, { "code": "341000", "name": "黄山市", "pid": "340000" }, { "code": "341100", "name": "滁州市", "pid": "340000" }, { "code": "341200", "name": "阜阳市", "pid": "340000" }, { "code": "341300", "name": "宿州市", "pid": "340000" }, { "code": "341500", "name": "六安市", "pid": "340000" }, { "code": "341600", "name": "亳州市", "pid": "340000" }, { "code": "341700", "name": "池州市", "pid": "340000" }, { "code": "341800", "name": "宣城市", "pid": "340000" }, { "code": "350000", "name": "福建省", "pid": "0" }, { "code": "350100", "name": "福州市", "pid": "350000" }, { "code": "350200", "name": "厦门市", "pid": "350000" }, { "code": "350300", "name": "莆田市", "pid": "350000" }, { "code": "350400", "name": "三明市", "pid": "350000" }, { "code": "350500", "name": "泉州市", "pid": "350000" }, { "code": "350600", "name": "漳州市", "pid": "350000" }, { "code": "350700", "name": "南平市", "pid": "350000" }, { "code": "350800", "name": "龙岩市", "pid": "350000" }, { "code": "350900", "name": "宁德市", "pid": "350000" }, { "code": "360000", "name": "江西省", "pid": "0" }, { "code": "360100", "name": "南昌市", "pid": "360000" }, { "code": "360200", "name": "景德镇市", "pid": "360000" }, { "code": "360300", "name": "萍乡市", "pid": "360000" }, { "code": "360400", "name": "九江市", "pid": "360000" }, { "code": "360500", "name": "新余市", "pid": "360000" }, { "code": "360600", "name": "鹰潭市", "pid": "360000" }, { "code": "360700", "name": "赣州市", "pid": "360000" }, { "code": "360800", "name": "吉安市", "pid": "360000" }, { "code": "360900", "name": "宜春市", "pid": "360000" }, { "code": "361000", "name": "抚州市", "pid": "360000" }, { "code": "361100", "name": "上饶市", "pid": "360000" }, { "code": "370000", "name": "山东省", "pid": "0" }, { "code": "370100", "name": "济南市", "pid": "370000" }, { "code": "370200", "name": "青岛市", "pid": "370000" }, { "code": "370300", "name": "淄博市", "pid": "370000" }, { "code": "370400", "name": "枣庄市", "pid": "370000" }, { "code": "370500", "name": "东营市", "pid": "370000" }, { "code": "370600", "name": "烟台市", "pid": "370000" }, { "code": "370700", "name": "潍坊市", "pid": "370000" }, { "code": "370800", "name": "济宁市", "pid": "370000" }, { "code": "370900", "name": "泰安市", "pid": "370000" }, { "code": "371000", "name": "威海市", "pid": "370000" }, { "code": "371100", "name": "日照市", "pid": "370000" }, { "code": "371200", "name": "莱芜市", "pid": "370000" }, { "code": "371300", "name": "临沂市", "pid": "370000" }, { "code": "371400", "name": "德州市", "pid": "370000" }, { "code": "371500", "name": "聊城市", "pid": "370000" }, { "code": "371600", "name": "滨州市", "pid": "370000" }, { "code": "371700", "name": "菏泽市", "pid": "370000" }, { "code": "410000", "name": "河南省", "pid": "0" }, { "code": "410100", "name": "郑州市", "pid": "410000" }, { "code": "410200", "name": "开封市", "pid": "410000" }, { "code": "410300", "name": "洛阳市", "pid": "410000" }, { "code": "410400", "name": "平顶山市", "pid": "410000" }, { "code": "410500", "name": "安阳市", "pid": "410000" }, { "code": "410600", "name": "鹤壁市", "pid": "410000" }, { "code": "410700", "name": "新乡市", "pid": "410000" }, { "code": "410800", "name": "焦作市", "pid": "410000" }, { "code": "410900", "name": "濮阳市", "pid": "410000" }, { "code": "411000", "name": "许昌市", "pid": "410000" }, { "code": "411100", "name": "漯河市", "pid": "410000" }, { "code": "411200", "name": "三门峡市", "pid": "410000" }, { "code": "411300", "name": "南阳市", "pid": "410000" }, { "code": "411400", "name": "商丘市", "pid": "410000" }, { "code": "411500", "name": "信阳市", "pid": "410000" }, { "code": "411600", "name": "周口市", "pid": "410000" }, { "code": "411700", "name": "驻马店市", "pid": "410000" }, { "code": "420000", "name": "湖北省", "pid": "0" }, { "code": "420100", "name": "武汉市", "pid": "420000" }, { "code": "420200", "name": "黄石市", "pid": "420000" }, { "code": "420300", "name": "十堰市", "pid": "420000" }, { "code": "420500", "name": "宜昌市", "pid": "420000" }, { "code": "420600", "name": "襄阳市", "pid": "420000" }, { "code": "420700", "name": "鄂州市", "pid": "420000" }, { "code": "420800", "name": "荆门市", "pid": "420000" }, { "code": "420900", "name": "孝感市", "pid": "420000" }, { "code": "421000", "name": "荆州市", "pid": "420000" }, { "code": "421100", "name": "黄冈市", "pid": "420000" }, { "code": "421200", "name": "咸宁市", "pid": "420000" }, { "code": "421300", "name": "随州市", "pid": "420000" }, { "code": "422800", "name": "恩施州", "pid": "420000" }, { "code": "430000", "name": "湖南省", "pid": "0" }, { "code": "430100", "name": "长沙市", "pid": "430000" }, { "code": "430200", "name": "株洲市", "pid": "430000" }, { "code": "430300", "name": "湘潭市", "pid": "430000" }, { "code": "430400", "name": "衡阳市", "pid": "430000" }, { "code": "430500", "name": "邵阳市", "pid": "430000" }, { "code": "430600", "name": "岳阳市", "pid": "430000" }, { "code": "430700", "name": "常德市", "pid": "430000" }, { "code": "430800", "name": "张家界市", "pid": "430000" }, { "code": "430900", "name": "益阳市", "pid": "430000" }, { "code": "431000", "name": "郴州市", "pid": "430000" }, { "code": "431100", "name": "永州市", "pid": "430000" }, { "code": "431200", "name": "怀化市", "pid": "430000" }, { "code": "431300", "name": "娄底市", "pid": "430000" }, { "code": "433100", "name": "湘西州", "pid": "430000" }, { "code": "440000", "name": "广东省", "pid": "0" }, { "code": "440100", "name": "广州市", "pid": "440000" }, { "code": "440200", "name": "韶关市", "pid": "440000" }, { "code": "440300", "name": "深圳市", "pid": "440000" }, { "code": "440400", "name": "珠海市", "pid": "440000" }, { "code": "440500", "name": "汕头市", "pid": "440000" }, { "code": "440600", "name": "佛山市", "pid": "440000" }, { "code": "440700", "name": "江门市", "pid": "440000" }, { "code": "440800", "name": "湛江市", "pid": "440000" }, { "code": "440900", "name": "茂名市", "pid": "440000" }, { "code": "441200", "name": "肇庆市", "pid": "440000" }, { "code": "441300", "name": "惠州市", "pid": "440000" }, { "code": "441400", "name": "梅州市", "pid": "440000" }, { "code": "441500", "name": "汕尾市", "pid": "440000" }, { "code": "441600", "name": "河源市", "pid": "440000" }, { "code": "441700", "name": "阳江市", "pid": "440000" }, { "code": "441800", "name": "清远市", "pid": "440000" }, { "code": "441900", "name": "东莞市", "pid": "440000" }, { "code": "442000", "name": "中山市", "pid": "440000" }, { "code": "445100", "name": "潮州市", "pid": "440000" }, { "code": "445200", "name": "揭阳市", "pid": "440000" }, { "code": "445300", "name": "云浮市", "pid": "440000" }, { "code": "450000", "name": "广西区", "pid": "0" }, { "code": "450100", "name": "南宁市", "pid": "450000" }, { "code": "450200", "name": "柳州市", "pid": "450000" }, { "code": "450300", "name": "桂林市", "pid": "450000" }, { "code": "450400", "name": "梧州市", "pid": "450000" }, { "code": "450500", "name": "北海市", "pid": "450000" }, { "code": "450600", "name": "防城港市", "pid": "450000" }, { "code": "450700", "name": "钦州市", "pid": "450000" }, { "code": "450800", "name": "贵港市", "pid": "450000" }, { "code": "450900", "name": "玉林市", "pid": "450000" }, { "code": "451000", "name": "百色市", "pid": "450000" }, { "code": "451100", "name": "贺州市", "pid": "450000" }, { "code": "451200", "name": "河池市", "pid": "450000" }, { "code": "451300", "name": "来宾市", "pid": "450000" }, { "code": "451400", "name": "崇左市", "pid": "450000" }, { "code": "460000", "name": "海南省", "pid": "0" }, { "code": "460100", "name": "海口市", "pid": "460000" }, { "code": "460200", "name": "三亚市", "pid": "460000" }, { "code": "500000", "name": "重庆市", "pid": "0" }, { "code": "500100", "name": "重庆市", "pid": "500000" }, { "code": "510000", "name": "四川省", "pid": "0" }, { "code": "510100", "name": "成都市", "pid": "510000" }, { "code": "510300", "name": "自贡市", "pid": "510000" }, { "code": "510400", "name": "攀枝花市", "pid": "510000" }, { "code": "510500", "name": "泸州市", "pid": "510000" }, { "code": "510600", "name": "德阳市", "pid": "510000" }, { "code": "510700", "name": "绵阳市", "pid": "510000" }, { "code": "510800", "name": "广元市", "pid": "510000" }, { "code": "510900", "name": "遂宁市", "pid": "510000" }, { "code": "511000", "name": "内江市", "pid": "510000" }, { "code": "511100", "name": "乐山市", "pid": "510000" }, { "code": "511300", "name": "南充市", "pid": "510000" }, { "code": "511400", "name": "眉山市", "pid": "510000" }, { "code": "511500", "name": "宜宾市", "pid": "510000" }, { "code": "511600", "name": "广安市", "pid": "510000" }, { "code": "511700", "name": "达州市", "pid": "510000" }, { "code": "511800", "name": "雅安市", "pid": "510000" }, { "code": "511900", "name": "巴中市", "pid": "510000" }, { "code": "512000", "name": "资阳市", "pid": "510000" }, { "code": "513200", "name": "阿坝州", "pid": "510000" }, { "code": "513300", "name": "甘孜州", "pid": "510000" }, { "code": "513400", "name": "凉山州", "pid": "510000" }, { "code": "520000", "name": "贵州省", "pid": "0" }, { "code": "520100", "name": "贵阳市", "pid": "520000" }, { "code": "520200", "name": "六盘水市", "pid": "520000" }, { "code": "520300", "name": "遵义市", "pid": "520000" }, { "code": "520400", "name": "安顺市", "pid": "520000" }, { "code": "520500", "name": "毕节市", "pid": "520000" }, { "code": "520600", "name": "铜仁市", "pid": "520000" }, { "code": "522300", "name": "黔西南州", "pid": "520000" }, { "code": "522600", "name": "黔东南州", "pid": "520000" }, { "code": "522700", "name": "黔南州", "pid": "520000" }, { "code": "530000", "name": "云南省", "pid": "0" }, { "code": "530100", "name": "昆明市", "pid": "530000" }, { "code": "530300", "name": "曲靖市", "pid": "530000" }, { "code": "530400", "name": "玉溪市", "pid": "530000" }, { "code": "530500", "name": "保山市", "pid": "530000" }, { "code": "530600", "name": "昭通市", "pid": "530000" }, { "code": "530700", "name": "丽江市", "pid": "530000" }, { "code": "530800", "name": "普洱市", "pid": "530000" }, { "code": "530900", "name": "临沧市", "pid": "530000" }, { "code": "532300", "name": "楚雄州", "pid": "530000" }, { "code": "532500", "name": "红河州", "pid": "530000" }, { "code": "532600", "name": "文山州", "pid": "530000" }, { "code": "532800", "name": "西双版纳州", "pid": "530000" }, { "code": "532900", "name": "大理州", "pid": "530000" }, { "code": "533100", "name": "德宏州", "pid": "530000" }, { "code": "533300", "name": "怒江州", "pid": "530000" }, { "code": "533400", "name": "迪庆州", "pid": "530000" }, { "code": "540000", "name": "西藏区", "pid": "0" }, { "code": "540100", "name": "拉萨市", "pid": "540000" }, { "code": "542100", "name": "昌都地区", "pid": "540000" }, { "code": "542200", "name": "山南地区", "pid": "540000" }, { "code": "542300", "name": "日喀则地区", "pid": "540000" }, { "code": "542400", "name": "那曲地区", "pid": "540000" }, { "code": "542500", "name": "阿里地区", "pid": "540000" }, { "code": "542600", "name": "林芝地区", "pid": "540000" }, { "code": "610000", "name": "陕西省", "pid": "0" }, { "code": "610100", "name": "西安市", "pid": "610000" }, { "code": "610200", "name": "铜川市", "pid": "610000" }, { "code": "610300", "name": "宝鸡市", "pid": "610000" }, { "code": "610400", "name": "咸阳市", "pid": "610000" }, { "code": "610500", "name": "渭南市", "pid": "610000" }, { "code": "610600", "name": "延安市", "pid": "610000" }, { "code": "610700", "name": "汉中市", "pid": "610000" }, { "code": "610800", "name": "榆林市", "pid": "610000" }, { "code": "610900", "name": "安康市", "pid": "610000" }, { "code": "611000", "name": "商洛市", "pid": "610000" }, { "code": "620000", "name": "甘肃省", "pid": "0" }, { "code": "620100", "name": "兰州市", "pid": "620000" }, { "code": "620200", "name": "嘉峪关市", "pid": "620000" }, { "code": "620300", "name": "金昌市", "pid": "620000" }, { "code": "620400", "name": "白银市", "pid": "620000" }, { "code": "620500", "name": "天水市", "pid": "620000" }, { "code": "620600", "name": "武威市", "pid": "620000" }, { "code": "620700", "name": "张掖市", "pid": "620000" }, { "code": "620800", "name": "平凉市", "pid": "620000" }, { "code": "620900", "name": "酒泉市", "pid": "620000" }, { "code": "621000", "name": "庆阳市", "pid": "620000" }, { "code": "621100", "name": "定西市", "pid": "620000" }, { "code": "621200", "name": "陇南市", "pid": "620000" }, { "code": "622900", "name": "临夏州", "pid": "620000" }, { "code": "623000", "name": "甘南州", "pid": "620000" }, { "code": "630000", "name": "青海省", "pid": "0" }, { "code": "630100", "name": "西宁市", "pid": "630000" }, { "code": "632100", "name": "海东地区", "pid": "630000" }, { "code": "632200", "name": "海北州", "pid": "630000" }, { "code": "632300", "name": "黄南州", "pid": "630000" }, { "code": "632500", "name": "海南州", "pid": "630000" }, { "code": "632600", "name": "果洛州", "pid": "630000" }, { "code": "632700", "name": "玉树州", "pid": "630000" }, { "code": "632800", "name": "海西州", "pid": "630000" }, { "code": "640000", "name": "宁夏区", "pid": "0" }, { "code": "640100", "name": "银川市", "pid": "640000" }, { "code": "640200", "name": "石嘴山市", "pid": "640000" }, { "code": "640300", "name": "吴忠市", "pid": "640000" }, { "code": "640400", "name": "固原市", "pid": "640000" }, { "code": "640500", "name": "中卫市", "pid": "640000" }, { "code": "650000", "name": "新疆区", "pid": "0" }, { "code": "650100", "name": "乌鲁木齐市", "pid": "650000" }, { "code": "650200", "name": "克拉玛依市", "pid": "650000" }, { "code": "652100", "name": "吐鲁番地区", "pid": "650000" }, { "code": "652200", "name": "哈密地区", "pid": "650000" }, { "code": "652300", "name": "昌吉州", "pid": "650000" }, { "code": "652700", "name": "博尔塔拉州", "pid": "650000" }, { "code": "652800", "name": "巴音郭楞州", "pid": "650000" }, { "code": "652900", "name": "阿克苏地区", "pid": "650000" }, { "code": "653000", "name": "克孜勒苏柯尔克孜州", "pid": "650000" }, { "code": "653100", "name": "喀什地区", "pid": "650000" }, { "code": "653200", "name": "和田地区", "pid": "650000" }, { "code": "654000", "name": "伊犁州", "pid": "650000" }, { "code": "654200", "name": "塔城地区", "pid": "650000" }, { "code": "654300", "name": "阿勒泰地区", "pid": "650000" }, { "code": "419001", "name": "济源市", "pid": "410000" }, { "code": "429004", "name": "仙桃市", "pid": "420000" }, { "code": "429005", "name": "潜江市", "pid": "420000" }, { "code": "429006", "name": "天门市", "pid": "420000" }, { "code": "429021", "name": "神农架林区", "pid": "420000" }, { "code": "469001", "name": "五指山市", "pid": "460000" }, { "code": "469002", "name": "琼海市", "pid": "460000" }, { "code": "469003", "name": "儋州市", "pid": "460000" }, { "code": "469005", "name": "文昌市", "pid": "460000" }, { "code": "469006", "name": "万宁市", "pid": "460000" }, { "code": "469007", "name": "东方市", "pid": "460000" }, { "code": "469021", "name": "定安县", "pid": "460000" }, { "code": "469022", "name": "屯昌县", "pid": "460000" }, { "code": "469023", "name": "澄迈县", "pid": "460000" }, { "code": "469024", "name": "临高县", "pid": "460000" }, { "code": "469025", "name": "白沙县", "pid": "460000" }, { "code": "469026", "name": "昌江县", "pid": "460000" }, { "code": "469027", "name": "乐东县", "pid": "460000" }, { "code": "469028", "name": "陵水县", "pid": "460000" }, { "code": "469029", "name": "保亭县", "pid": "460000" }, { "code": "469030", "name": "琼中县", "pid": "460000" }, { "code": "469031", "name": "西沙群岛", "pid": "460000" }, { "code": "469032", "name": "南沙群岛", "pid": "460000" }, { "code": "469033", "name": "中沙群岛", "pid": "460000" } ] //#region "处理省市数据" var cmbProvinceData = [], //记录所有省份 cmbCity = []; //记录所有城市 $(function () { setProvinceCityData(); }) function setProvinceCityData() { cmbProvinceData = [], cmbCity = []; $.each(PCData, function (k, d) { if (d.pid == 0) { cmbProvinceData.push(d); } else { cmbCity.push(d); } }); } //获取省份 function getProvinceData() { if (cmbProvinceData.length == 0) { setProvinceCityData(); } return cmbProvinceData; } //获取对应省份下的城市 function getCityData(proCode) { var rzt = []; if (proCode == undefined) return rzt; if (cmbCity.length == 0) { setProvinceCityData(); } $.each(cmbCity, function (k, c) { if (c.pid == proCode) { rzt.push(c); } }); return rzt; } //#endregion