I found that there is QQ own JS province/city level 3 linkage in the http://ip.qq.com/website. So I studied it. The interface is as follows:
Why not directly use the data?
The surprise is that QQ uses external JS references to achieve three-level linkage. JS is as follows: http://ip.qq.com/js/geo.js
The usage is as follows:
Copy codeThe Code is as follows:
<! DOCTYPE html>
<Html>
<Head>
<Title> qq js provincial/municipal level-3 linkage </title>
<! -- Directly use QQ's provincial and municipal data -->
<! --
<Script type = "text/javascript" src = "http://ip.qq.com/js/geo.js"> </script>
-->
<Script type = "text/javascript" src = "geo. js"> </script>
</Head>
<Body onload = "setup (); preselect ('shaanxi province '); promptinfo ();">
<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 = "submit"/>
</Form>
<Script>
// This function is required because it 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>
</Html>