补2017.5.13另一个

Posted 雪花飘刂

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了补2017.5.13另一个相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script src="../jquery-1.11.2.min.js"></script>
    </head>
    <body>
        <select id="sheng"></select>
        <select id="shi"></select>
        <select id="qu"></select>
    </body>
</html>
<script type="text/javascript">  
  $(document).ready(function(e){   
    //输出省
        var code = "0001";
        $.ajax({     
            async:false,
            //取消异步
            url:"chuli.php",
            data:{code:code},
            type:"POST",
            dataType:"TEXT",
            success:function(data){                            
                    var hang = data.trim().split("|");  //trim()去空格
                    var str="";    
                    for(var i=0;i<hang.length;i++)
                    {
                        var lie = hang[i].split("^");
                        str = str+"<option value=‘"+lie[0]+"‘>"+lie[1]+"</option>";
                    }
                    $("#sheng").html(str);             
                }                      
    });
//输出市
    $("#sheng").click(function(){  
    var code2=$("#sheng").val(); 
 
        $.ajax({
            async:false,
            url:"chuli.php",
            data:{code:code2},
            type:"POST",
            dataType:"TEXT",
        success:function(data2){
 
                var hang2 = data2.trim().split("|");
 
                var str2 ="";
                for(var i=0;i<hang2.length;i++)
                {
                    var lie2=hang2[i].split("^");
                    str2 = str2 +"<option value =‘"+lie2[0]+"‘>"+lie2[1]+"</option>";
                }
                $("#shi").html(str2);
            }              
        });    
    })
//输出区县
$("#shi").click(function(){
    var code3=$("#shi").val();
 
    $.ajax({
            async:false,
            url:"chuli.php",
            data:{code:code3},
            type:"POST",
            dataType:"TEXT",
            success:function(data3){
                var hang3 = data3.split("|");
                var str3 ="";
                for(var i=0;i<hang3.length;i++)
                {
                    var lie3=hang3[i].split("^");
                    str3 = str3 +"<option value =‘"+lie3[0]+"‘>"+lie3[1]+"</option>";
                }
                $("#qu").html(str3);
            }              
        });
  })
})
</script>
 
 
 
 
这个好像有问题。。。。。。。而且,这个运行超慢~

以上是关于补2017.5.13另一个的主要内容,如果未能解决你的问题,请参考以下文章

C#VS快捷键

C#VS快捷键

C#VS快捷键

C#VS快捷键

Atom编辑器折腾记_(15)JS代码片段补全(插件:javascript-snippets)

使用意图从另一个片段调用一个片段