个人比较喜欢用的省市联动,个人省市联动
这是使用QQ网站用的js来实现省市区三级联动的。引用非常方便
前台:
<!DOCTYPE html> <html> <head> <title>QQ JS省市区三级联动</title> <!-- 直接使用QQ的省市区数据 --> <!-- <script type=<span>"</span><span>text/javascript</span><span>"</span> src=<span>"</span><span>http://ip.qq.com/js/geo.js</span><span>"</span>></script> --> <script type=<span>"</span><span>text/javascript</span><span>"</span> src=<span>"</span><span>geo.js</span><span>"</span>></script> </head> <body onload=<span>"</span><span>setup();preselect('陕西省');promptinfo();</span><span>"</span>> <form> <<span>select</span> <span>class</span>=<span>"</span><span>select</span><span>"</span> name=<span>"</span><span>province</span><span>"</span> id=<span>"</span><span>s1</span><span>"</span>> <option></option> </<span>select</span>> <<span>select</span> <span>class</span>=<span>"</span><span>select</span><span>"</span> name=<span>"</span><span>city</span><span>"</span> id=<span>"</span><span>s2</span><span>"</span>> <option></option> </<span>select</span>> <<span>select</span> <span>class</span>=<span>"</span><span>select</span><span>"</span> name=<span>"</span><span>town</span><span>"</span> id=<span>"</span><span>s3</span><span>"</span>> <option></option> </<span>select</span>> <input id=<span>"</span><span>address</span><span>"</span> name=<span>"</span><span>address</span><span>"</span> type=<span>"</span><span>hidden</span><span>"</span> value=<span>""</span> /> <input onclick=<span>"</span><span>alert(document.getElementById('address').value); return false;</span><span>"</span> type=<span>"</span><span>submit</span><span>"</span> value=<span>"</span><span>提交</span><span>"</span> /> </form> <script> <span>//</span><span>这个函数是必须的,因为在geo.js里每次更改地址时会调用此函数</span> <span>function promptinfo() { </span><span>var</span> address = document.getElementById(<span>'</span><span>address</span><span>'</span><span>); </span><span>var</span> s1 = document.getElementById(<span>'</span><span>s1</span><span>'</span><span>); </span><span>var</span> s2 = document.getElementById(<span>'</span><span>s2</span><span>'</span><span>); </span><span>var</span> s3 = document.getElementById(<span>'</span><span>s3</span><span>'</span><span>); address.value </span>= s1.value + s2.value +<span> s3.value; } </span></script> </body> </html>
后台用的是js。
实例下载:http://files.cnblogs.com/zjfree/qqJsAddress.rar
原文链接: http://www.cnblogs.com/zjfree/

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Notepad++7.3.1
Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6
Visual web development tools
