请将问题描述具体点!这样可以吗? document.write "<a href=test.htm>你要的链接</a>"

解决方案 »

  1.   

    lmh79(阿楚)  我不是要这种。比方说:
    W="www.csdn.net"
    if(a=="F")
    {
          执行W连接!!
    }
      

  2.   

    可是我连不上!!我的原代码:<script language = "JavaScript">
         function getRadioValue(radioObject) {
    var value = null
              for (var i=0; i<radioObject.length; i++) {
                   if (radioObject[i].checked) {
                        value = radioObject[i].value
                        break }
              }if(value=="用户"){
    gourl="http://www.sina.com.cn"
        window.licalhost.hash=gourl

    }else{
    alert("1234556677");
    }}
    </script><form name="form1">
                    <p>
                      <input type="radio" name="songs" value="用户">
                      按用户 </p>
                    <p> 
                      <input type="radio" name="songs" value="水点">
                      按水点 
                      <input type="text" name="text">
                    </p>
         
                  <p>&nbsp;</p>
                
                    <input type="button" name="Submit" value="下一步" onClick="getRadioValue(this.form.songs)">
                  </form>
      

  3.   

    if(value=="用户"){
        gourl="http://www.sina.com.cn"
        window.licalhost.hash=gourl
        
    }
    应为
    if(value=="用户"){
        gourl="http://www.sina.com.cn"
        window.location.href=gourl
        
    }
      

  4.   

    to huisheng:
    你的只有一个错误,就是下面这句
         window.location=gourl
    我把你原来的切过来,你再试试!
    <html>
    <head>
    <title>无标题文档</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <script language = "JavaScript">
        function getRadioValue(radioObject) {
    var value = null
              for (var i=0; i<radioObject.length; i++) {
                  if (radioObject[i].checked) {
                        value = radioObject[i].value
                        break }
              }if(value=="用户"){
        gourl="http://www.sina.com.cn"
        window.location=gourl
        
    }else{
        alert("1234556677");
    }}
    </script><form name="form1">
                    <p>
                      <input type="radio" name="songs" value="用户">
                      按用户 </p>
                    <p> 
                      <input type="radio" name="songs" value="水点">
                      按水点 
                      <input type="text" name="text">
                    </p>
        
                  <p>&nbsp;</p>
                
                    <input type="button" name="Submit" value="下一步" onClick="getRadioValue(this.form.songs)">
                  </form>
    </html>