Ajax implements the pop-up function code for refreshing new city selection and ajax code
The example in this article describes how to implement the pop-up brushless new city selection function using Ajax. Share it with you for your reference. The details are as follows:
This is a great national city selection effect. When adding a city, add the Group first: Find the select tag in "selectSub" with the id, add the option tag, and the value Attribute increments, find that the id is "selectSub", add the div according to the original format, and its id attribute increases progressively. Then add the option of secondary selection: copy the id to any input tag under "selectSub, paste it at the location you want to add. If you want to expand it, you can use dynamic language to read the city from the database.
The running effect is as follows:
The Online Demo address is as follows:
Http://demo.jb51.net/js/2015/js-ajax-dialog-cha-city-codes/
The Code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <Head> <title> Ajax pop-up brushless new city selection effect </title> <meta http-equiv =" content-type "content =" text/html; charset = gb2312 "> <style type =" text/css "> BODY {FONT-SIZE: 12px; PADDING-TOP: 50px} H2 {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px }. bton {BORDER-RIGHT: # ccc 1px solid; BORDER-TOP: # ccc 1px solid; BACKGROUND: # ddd; BORDER-LEFT: # c Cc 1px solid; BORDER-BOTTOM: # ccc 1px solid }. cont {PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px} # main {MARGIN: 0px auto; WIDTH: 400px} # selectItem {BORDER-RIGHT: #000 1px solid; BORDER-TOP: #000 1px solid; MARGIN-TOP: 10px; Z-INDEX: 2; BACKGROUND: # fff; OVERFLOW: hidden; BORDER-LEFT: #000 1px solid; WIDTH: 400px; BORDER-BOTTOM: #000 1px solid; POSITION: absolu Te; TOP: 0px} # preview {BORDER-RIGHT: # ccc 1px solid; BORDER-TOP: # ccc 1px solid; MARGIN: 1px; BORDER-LEFT: # ccc 1px solid; BORDER-BOTTOM: # ccc 1px solid} # result {BORDER-RIGHT: # ccc 1px solid; BORDER-TOP: # ccc 1px solid; MARGIN-TOP: 10px; BORDER-LEFT: # ccc 1px solid; BORDER-BOTTOM: # ccc 1px solid }. tit {PADDING-LEFT: 10px; MARGIN: 1px; LINE-HEIGHT: 20px; HEIGHT: 20px }. bgc_ccc {BACKGROUND: # ccc }. Bgc_eee {BACKGROUND: # eee }. c_999 {COLOR: #999 }. pointer {CURSOR: pointer }. left {FLOAT: left }. right {FLOAT: right }. cls {CLEAR: both; FONT-SIZE: 0px; OVERFLOW: hidden; HEIGHT: 0px} # bg {DISPLAY: none; Z-INDEX: 1; BACKGROUND: # ccc; FILTER: alpha (opacity = 70); LEFT: 0px; WIDTH: 100%; POSITION: absolute; TOP: 0px; opacity: 0.7 }. hidden {DISPLAY: none }. move {CURSOR: move }</style>
I hope this article will help you with Ajax programming.