zoukankan      html  css  js  c++  java
  • MVC省市二级联动

    <script>
            $(function () {
                ShowSheng();
            })
            function ShowSheng() {
                $.ajax({
                    url: "/Home/Sheng",
                    type: "get",
                    dataType: "json",
                    success: function (da) {
                        $(da).each(function (index, item) {
                            $("#S1").append("<option value='" + item.Aid + "'>" + item.Aname + "</option>");
                        })
                    }
                })
            }
            function SelQu(t) {
                var m = $(t).val();
                $.ajax({
                    url: "/Home/Shi",
                    type: "get",
                    data: { id: m },
                    dataType: "json",
                    success: function (da) {
                        $("#S2").empty();
                        $(da).each(function (index, item) {
                            $("#S2").append("<option value='" + item.Aid + "'>" + item.Aname + "</option>");
                        })
                    }
                })
            }
        </script>
     
    <div>
    省市:<select id="S1" onchange="SelQu(this)"><option value="0">---请选择省市---</option></select>区镇:<select id="S2"><option value="0">---请选择区镇---</option></select>
    </div>
  • 相关阅读:
    CDQ分治
    [noip模拟赛2017.7.15]
    [noip模拟赛2017.7.11]
    [noip模拟赛2017.7.10]
    [noip模拟赛2017.7.7]
    [noip模拟赛2017.7.6]
    [noip模拟赛2017.7.4]
    回文检测
    mapreduce引用第三方jar
    Spark安装和配置
  • 原文地址:https://www.cnblogs.com/huosanpie/p/9999539.html
Copyright © 2011-2022 走看看