I found that the website http://ip.qq.com/ has QQ’s own JS three-level linkage between provinces and municipalities. So I researched it. His interface is as follows:
Why not just use the data?
Surprisingly, QQ uses external JS to achieve three-level linkage. JS is as follows: http://ip.qq.com/js/geo.js
How to use it:
Copy the code code as follows:
<!DOCTYPE html>
<html>
<head>
<title>QQ JS three-level linkage between provinces and municipalities</title>
<!-- Directly use QQ’s province and city 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 name="province" id="s1">
<option></option>
</select>
<select name="city" id="s2">
<option></option>
</select>
<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 necessary 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>
</html>