zoukankan      html  css  js  c++  java
  • 用Javascript获取select的值 yangan

     <script type="text/javascript">
     function GetValue()
     {
      var strUrl;  
      strUrl=window.document.getElementById("friendLink").value;
      
      window.open("http://22+strurl/);  
       
     }
    </script>

    //根据链接类型读取数据库中的数据

            public static string GetLink(string type)
            {
                string sqlTemp = "select * from shang_cms_friends where lianjie_pic ='" + type + "'";
                DataSet ds = SQLHelper.DataAdapter(sqlTemp, SQLHelper.SDACmd.select, "sqlIndex");

                string link = null;
                string strSelectStart = "<select id=friendLink name=friendLink style=275px;height:27px; onChange=javascript:GetValue(); >";
                if (type == "0")
                {
                    link = strSelectStart + "<option selected=selected>--------友情链接--------</option>";
                }
                else
                {
                    link = strSelectStart + "<option selected=selected>--------子公司链接--------</option>";
                }

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {

                    link += "<option value="+ds.Tables[0].Rows[i]["lianjie_url"].ToString()+">" + ds.Tables[0].Rows[i]["lianjie_name"].ToString() + "</option>";
                }

                link += "</select>";

                return link;

               // <select id="friendLink" name="friendLink" style=" 275px; height: 27px;">
                 //       <option selected="selected">--------友情链接--------</option>
                 //   </select>
            }

  • 相关阅读:
    vuex之store拆分即多模块状态管理
    vue项目中使用vueX
    vue中父子组件的参数传递和应用
    VUE中使用vue-awesome-swiper
    VUE真实项目中常用的生命周期和参数
    VUE生命周期
    vue+mockjs 模拟数据,请求回调的应用
    Vue项目搭建与部署还有调试插件Vue.js devtools
    tableTD中添加对角斜线
    前端面试题及答案,理论知识
  • 原文地址:https://www.cnblogs.com/xlx0210/p/1519928.html
Copyright © 2011-2022 走看看