1 function addresssplit(address) {//分割身份证地址 2 var zsplit = { 3 province: ['省', '自治区'], 4 city: ['市', '地区', '州', '盟'], 5 district: ['区', '县', '旗'], 6 town: ['乡', '镇', '街道', '苏木'], 7 road: ["街", "路", "巷", "胡同", "里弄", "村", "嘎查", "道"], 8 group: ['组', '社'], 9 num: ['号'], 10 building: ['幢', '栋', '楼', '座', '附', '号'], 11 unit: ['单元'], 12 doornum: ['室', '户'] 13 }; 14 var result = {}; 15 16 $.each(zsplit, function (i, n) { 17 result[i] = ''; 18 $.each(n, function (j, k) { 19 if (address.indexOf(k) > 0) { 20 var arr = address.split(k);//分割 21 result[i] = arr[0] + k;//加上当前 名 22 arr.shift();//移除第一个 23 address = arr.join(''); 24 } 25 }); 26 }); 27 28 return result; 29 }