Home > Web Front-end > JS Tutorial > Pure JS province and city three-level linkage menu extracted from QQ website_javascript skills

Pure JS province and city three-level linkage menu extracted from QQ website_javascript skills

WBOY
Release: 2016-05-16 17:07:14
Original
935 people have browsed it

I found that the website http://ip.qq.com/ has QQ’s own JS three-level linkage between provinces and cities. So I researched it. His interface is as follows:
Pure JS province and city three-level linkage menu extracted from QQ website_javascript skills
Why not use the data directly?

What is surprising is that QQ uses external JS to achieve three-level linkage. The JS is as follows: http://ip.qq.com/js/geo.js

The usage method is as follows:

Copy code The code is as follows:




QQ JS provincial and municipal level three Linkage












<script> <br><br>//This function is necessary because it will be called every time the address is changed in geo.js <br>function promptinfo() <br>{ <br>var address = document.getElementById('address'); <br>var s1 = document.getElementById('s1'); <br>var s2 = document.getElementById('s2'); <br> var s3 = document.getElementById('s3'); <br>address.value = s1.value s2.value s3.value; <br>} <br><br></script>


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template