zoukankan      html  css  js  c++  java
  • 如何根据Jquery实现两级联动

    <script language="javascript" type="text/javascript" >
    $(function (){
          $.ajax({
                url:<select:link page="/tobaccoinfo.do?method=getBrandList" />,
                type: "get" ,
                dataType: "json" ,
                success: function (result){
                       var str="<option value=''>全部</option>" ;
                       for (var i=0;i<result.length;i++){
                            str+= "<option value="+result[i].id+">"+result[i].name+ "</option>" ;
                      }
                      $( "#brandid" ).html(str);
                }
          });
          $( "#brandid" ).change( function(){
                 var brandid=$("#brandid" ).val();
                $.ajax({
                      url:<select:link page="/tobaccoinfo.do?method=getTobaccoName" />,
                      type: 'get' ,
                      data:{
                             'brandid' :brandid
                      },
                      dataType: 'json' ,
                      success: function (result){
                             var str="<option value=''>全部</option>" ;
                             for (var i=0;i<result.length;i++){
                                  str+= "<option value="+result[i].id_+ ">"+result[i].name_+ "</option>" ;
                            }
                            $( "#tobaccoId" ).empty().html(str);
                      }
                });
          });
    });
    </script>

    <body>卷烟品牌:<select:select property="brandid" addspacerow="false" style="100px" ></select:select>
    卷烟名称:<select:select property="tobaccoId" addspacerow="false" style="120px" ></select:select></body>

  • 相关阅读:
    Oracle 自定义聚合函数
    PL/SQL Developer背景色设置
    Oracle 所有关键字查询视图 V$RESERVED_WORDS
    react创建ts项目
    chrome如何导出已经安装的扩展程序为.crx文件?
    If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your
    vue脚手架配置环境变量
    sourceTree系列二:创建分支,并推送到远程上
    sourceTree系列一:合并分支,把uat的代码合并到dev上
    如何在typescript中解决 error TS2451: Cannot redeclare block-scoped variable 'name'
  • 原文地址:https://www.cnblogs.com/hc1020/p/5067220.html
Copyright © 2011-2022 走看看