sql建表
HTML——HTMLPage1.htm
- <htmlxmlns="http://www.w3.org/1999/xhtml">
- head>
- title>Ajax实现省市县三级联动【无刷新】三层</styletype="text/css" select
- {
- width:130px;
- }
- stylescriptsrc="js/Jquery1.7.js"type="text/javascript">scriptscripttype="text/javascript" $(function(){
- $.ajax({
- type:"post",
- contentType:"application/json",
- url:"WebService1.asmx/GetProvince",108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px"> data:"{}",248); line-height:18px"> success:function(result){
- varstroption='';
- for(vari=0;i<result.d.length;i++){
- stroption+='optionvalue='+result.d[i].provinceID+'>';
- stroption+=result.d[i].provincename;
- option $('#seprovince').append(stroption);
- })
- $('#seprovince').change(function(){
- $('#secityoption:gt(0)').remove();
- $('#seareaoption:gt(0)').remove();
- $.ajax({
- type:"post",248); line-height:18px"> contentType:"application/json",108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px"> url:"WebService1.asmx/GetCItyByPro",248); line-height:18px"> data:"{proid:'"+$(this).val()+"'}",108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px"> success:function(result){
- varstrocity='';
- for(vari=0;iresult.d.length;i++){
- strocity+='optionvalue='+result.d[i].cityID+'>';
- strocity+=result.d[i].cityname;
- }
- $('#secity').append(strocity);
- })
- $('#secity').change(function(){
- url:"WebService1.asmx/GetAreaByCity",108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px"> data:"{cityid:'"+$(this).val()+"'}",108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px"> varstroarea='';
- stroarea+='optionvalue='+result.d[i].areaID+' stroarea+=result.d[i].areaname;
- $('#searea').append(stroarea);
- bodytabletrtd 用户名
- inputid="Text1"type="text"/>
- 密码
- inputid="Text2"type="text" 确认密码
- inputid="Text3"type="text" 邮箱
- inputid="Text4"type="text" 地址
- selectid="seprovince">--请选择--select 省
- selectid="secity">市
- selectid="searea">县
- html>
创建Web服务——WebService1.asmx
copy