zoukankan      html  css  js  c++  java
  • 无刷新三级联动

       <script type="text/javascript">         $(function () {             $.ajax({                 type: "post",                 contentType: "application/json",                 url: "WebService1.asmx/GetListProvince",                 Data: "{}",                 success: function (result) {                     var strDrop = '';                     for (var i = 0; i < result.d.length; i++) {                         strDrop += "<option value='" + result.d[i].provinceID + "' >" + result.d[i].provinceName + "</option>";                     }                     $('#Province').append(strDrop);                 }             })
                $('#Province').change(function () {                 $('#City option:gt(0)').remove();                 $('#Area option:gt(0)').remove();                 $.ajax({                     type: "post",                     contentType: "application/json",                     url: "WebService1.asmx/GetListCity",                     data: "{Id:'" + $(this).val() + "'}",                     success: function (result) {                         var strCity = '';                         for (var i = 0; i < result.d.length; i++) {                             strCity += "<option value='" + result.d[i].cityID + "' >" + result.d[i].cityName + "</option>";                         }                         $('#City').append(strCity);                     }                 })             })
                $('#City').change(function () {                 $('#Area option:gt(0)').remove();                 $.ajax({                     type: "post",                     contentType: "application/json",                     url: "WebService1.asmx/GetListArea",                     data: "{Id:'" + $(this).val() + "'}",                     success: function (result) {                         var strArea = '';                         for (var i = 0; i < result.d.length; i++) {                             strArea += "<option value='" + result.d[i].areaID + "' >" + result.d[i].areaName + "</option>";                         }                         $('#Area').append(strArea);                     }                 })             })
            })     </script>

     

     

    <select id="Province">

           <option>--请选择--</option>
        </select>省
        <select id="City">
           <option>--请选择--</option>
        </select>市
        <select id="Area">
          <option>--请选择--</option>

        </select>县

     

    WebService

     

          [WebMethod]         public List<Model.province> GetListProvince()         {             BLL.province bll_Province = new BLL.province();             List<Model.province> list = bll_Province.GetListModel();             return list;         }
            [WebMethod]         public List<Model.city> GetListCity(string Id)          {             BLL.city bll_City = new BLL.city();             List<Model.city> list = bll_City.GetListCity("father='"+Id+"'");             return list;         }
            [WebMethod]         public List<Model.area> GetListArea(string Id)         {             BLL.area bll_area = new BLL.area();             List<Model.area> list = bll_area.GetlistArea("father='" + Id + "'");             return list;         }

    三层的方法同上一篇文章的三层相同

  • 相关阅读:
    directX--关于CSource和CSourceStream (谁调用了fillbuffer) 分类: DirectX 2014-11-11 08:10 635人阅读 评论(0) 收藏
    把连续动态bmp转换为avi 分类: 文件格式 VC++ ffmpeg-SDL-VLC-Live555 DirectX 2014-11-07 14:54 516人阅读 评论(0) 收藏
    ioftpd read/write 锁实现
    编译 ioftpd v7.7.3
    3D Math Primer for Graphics and Game Development -- 图形与游戏开发(3D数学基础) (简介)
    E. Turn Off The TV Educational Codeforces Round 29
    D. Mahmoud and Ehab and the binary string Codeforces Round #435 (Div. 2)
    D. Dog Show 2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest, qualification stage (Online Mirror, ACM-ICPC Rules, Teams Preferred)
    D. Huge Strings Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)
    E. Mahmoud and Ehab and the function Codeforces Round #435 (Div. 2)
  • 原文地址:https://www.cnblogs.com/qiqiBoKe/p/3103131.html
Copyright © 2011-2022 走看看