<%
  myselectvalue=Request("myselectvalue")
  lm=Request("lm")
  fr=Request("fr")
  ct=Request("ct")
  pn=Request("pn")
  tn=Request("tn")
  rn=Request("rn")
  wdtxt=Server.HTMLEncode(Request("wdtxt"))
  if myselectvalue="16" then
%>
<form name="search_form1" method="get" action="http://zhidao.baidu.com/q">
  <input type=hidden name=word value=<%=wdtxt%>>  
  <input type=hidden name=lm value=<%=lm%>>
  <input type=hidden name=fr value=<%=fr%>>
  <input type=hidden name=ct value=<%=ct%>>
  <input type=hidden name=pn value=<%=pn%>>
  <input type=hidden name=tn value=<%=tn%>> 
  <input type=hidden name=rn value=<%=rn%>>   
</form>
<SCRIPT LANGUAGE="JAVASCRIPT">document.search_form1.submit();</SCRIPT>
<%
  end if
  if myselectvalue="17" then
%>
<script language=javascript>
    location.href="http://wenwen.soso.com/z/Search.e?sp=S"+encodeURIComponent("<%=wdtxt%>");
</script>
<%
  end if
  if myselectbalue="18" then
%>
<script language=javascript>
    location.href="http://wenda.tianya.cn/wenda/search?q="+encodeURIComponent("<%=wdtxt%>")+"&hl=zh-CN";
</script>
<%end if%>这段有错吗?document.search_form1.submit();这句运行,后面的两个location.href都不运行,在浏览器中查看源文件显示为
<script language=javascript>
    location.href="http://wenwen.soso.com/z/Search.e?sp=S"+encodeURIComponent("你好");//<--你好为前一个网页提交
</script>

解决方案 »

  1.   

    另外这段也是不运行..
    var xw;
      if(document.xwss.myselectvalue.value=="19"){
        xw="http://news.baidu.com/ns?word="+document.getElementById("xwts").value+"&tn=news&cl=2&rn=20";
        alert(xw);
        window.open(xw);
        return false;
      }
      if(document.xwss.myselectvalue.value=="20"{
        xw="http://news.google.cn/news/search?pz=1&cf=all&ned=ccn&hl=zh-CN&q="+encodeURIComponent(document.getElementById("xwts").value);
        alert(xw);
        window.open(xw);
        return false;
      }
      if(document.xwss.myselectvalue.value=="21"{
      alert(xw);
        xw="http://news.soso.com/n.q?sc=news&pid=n.idx&uin=&w="+document.getElementById("xwts").value;
        return false;
      }
      return true;
    }昨天晚上还运行来着,今天没动再看就不能用了...
      

  2.   

    不会的,myselectvalue是有值的,因为我在定义时用的是<input type=hidden name=myselectvalue value="16">就算值不改变,也应该有一个16的最初值传过来
      

  3.   

    而且在IE中查看源文件显示为
    <script language=javascript> 
        location.href="http://wenwen.soso.com/z/Search.e?sp=S"+encodeURIComponent("你好");
    </script>
    说明ASP的IF已经起作用了,只是这句JAVASCRIPT不跳转