I found in http://ip.qq.com/'s website has qq own JS province city three level linkage. So I did a bit of research. His interface is as follows:
Why not use the data directly?
The surprise is QQ is to use the reference external JS to achieve three-level linkage. JS as follows: Http://ip.qq.com/js/geo.js
Use the following methods:
Copy Code code as follows:
<! DOCTYPE html>
<title>qq JS Province Urban three-level linkage </title>
<!--data--> of the city and province using QQ directly
<!--
<script type= "Text/javascript" src= "Http://ip.qq.com/js/geo.js" ></script>
-->
<script type= "Text/javascript" src= "Geo.js" ></script>
<body onload= "setup ();p reselect (' Shaanxi province ');p Romptinfo (); >
<form>
<select class= "Select" name= "province" id= "S1" >
<option></option>
</select>
<select class= "Select" Name= "City" id= "S2" >
<option></option>
</select>
<select class= "Select" Name= "Town" id= "S3" >
<option></option>
</select>
<input id= "Address" name= "address" type= "hidden" value= "/>" "
<input onclick= "alert (document.getElementById (' address '). Value); return false; "type=" Submit "value=" Submission "/>
</form>
<script>
This function is required because this function is called every time the address is changed in Geo.js
function Promptinfo ()
{
var address = document.getElementById (' address ');
var S1 = document.getElementById (' s1 ');
var s2 = document.getElementById (' s2 ');
var s3 = document.getElementById (' S3 ');
Address.value = s1.value + S2.value + s3.value;
}
</script>
</body>