javascript问题,同时取的2个值?
<%setrssorts=server.createobject("adodb.recordset")rssorts.open"selectsorts,sortsid,c...
<%
set rssorts=server.createobject("adodb.recordset")
rssorts.open "select sorts,sortsid,categoryid from sorts order by categoryid",conn,1,1
%>
<select name="Selectsorts" id="Selectsorts" onchange="URL_Data(this)">
<option selected>请选择分类</option>
<% Do While Not rssorts.Eof %>
<option value="<% = Trim(rssorts("categoryid")) %>">
<% = rssorts("sorts")%>
</option>
<%
rssorts.movenext
Loop
rssorts.close
set rssorts=nothing
%>
</select>
<script language ="javascript" type ="text/javascript" >
//地址转向
function URL_Data(obj,tab)
{
location.href="pro_list.asp?aid="A"&nid"B" %>";
}
</script>
如何取得A B 2个值?
注:我只能获取其中一个 展开
set rssorts=server.createobject("adodb.recordset")
rssorts.open "select sorts,sortsid,categoryid from sorts order by categoryid",conn,1,1
%>
<select name="Selectsorts" id="Selectsorts" onchange="URL_Data(this)">
<option selected>请选择分类</option>
<% Do While Not rssorts.Eof %>
<option value="<% = Trim(rssorts("categoryid")) %>">
<% = rssorts("sorts")%>
</option>
<%
rssorts.movenext
Loop
rssorts.close
set rssorts=nothing
%>
</select>
<script language ="javascript" type ="text/javascript" >
//地址转向
function URL_Data(obj,tab)
{
location.href="pro_list.asp?aid="A"&nid"B" %>";
}
</script>
如何取得A B 2个值?
注:我只能获取其中一个 展开
3个回答
展开全部
<script language ="javascript" type ="text/javascript" >
//地址转向
function URL_Data(obj,tab)
{
location.href="pro_list.asp?aid="A"&nid"B" %>";
}
</script>
改成:
<script language ="javascript" type ="text/javascript" >
//地址转向
function URL_Data(obj,tab)
{
location.href="pro_list.asp?aid="+obj.options[obj.selectedIndex].value+"&nid"+obj.options[obj.selectedIndex].text;
}
</script>
//地址转向
function URL_Data(obj,tab)
{
location.href="pro_list.asp?aid="A"&nid"B" %>";
}
</script>
改成:
<script language ="javascript" type ="text/javascript" >
//地址转向
function URL_Data(obj,tab)
{
location.href="pro_list.asp?aid="+obj.options[obj.selectedIndex].value+"&nid"+obj.options[obj.selectedIndex].text;
}
</script>
展开全部
A、B是变量?如果是变量,那么你都没有对他们进行赋值,如果A、B变量值传递则这样写:
location.href="pro_list.asp?aid="+A+"&nid="+B;
如果只是想传aid=A、nid=B,则这样写
location.href="pro_list.asp?aid=A&nid=B";
location.href="pro_list.asp?aid="+A+"&nid="+B;
如果只是想传aid=A、nid=B,则这样写
location.href="pro_list.asp?aid=A&nid=B";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<select name="Selectsorts" id="Selectsorts" onchange="URL_Data(this.options[this.selectIndex].value,this.options[this.selectIndex].text)">
Ok
Ok
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询