JSON 数据,实现省市县三级联动下拉菜单
JSON 数据,实现省市县三级联动下拉菜单
只需要几行代码即搞定:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>hooyes Tester</title>
<script type="text/javascript" src="hooyes.Script/jquery.js"></script>
<script type="text/javascript" src="hooyes.Script/citys.js"></script>
<script type="text/javascript" src="hooyes.Script/RegisterAdapter.js"></script>
<link href="hooyes.Css/hooyes.Region.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" action="" name="form1">
<select id="Select1" name="Select1"></select>
<select id="Select2" name="Select2"></select>
<select id="Select3" name="Select3"></select>
</form>
</body>
</html>
<head>
<title>hooyes Tester</title>
<script type="text/javascript" src="hooyes.Script/jquery.js"></script>
<script type="text/javascript" src="hooyes.Script/citys.js"></script>
<script type="text/javascript" src="hooyes.Script/RegisterAdapter.js"></script>
<link href="hooyes.Css/hooyes.Region.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" action="" name="form1">
<select id="Select1" name="Select1"></select>
<select id="Select2" name="Select2"></select>
<select id="Select3" name="Select3"></select>
</form>
</body>
</html>
Citys.js 是JSON格式的省市数据,根据需要修改即可
查看演示:
演示1: demo For Developer
演示2: 一个实际应用的例子
下载本例代码: DownLoad