我想在一个页面中的点击一个超级链接在同一窗口打开新页面以下是调用的jsfunction test1()
{
var loginname="<%=loginName%>";
var transpassword="<%=origPassword%>";
self.location.href="./judgeChangePassword.jsp?loginName="+loginname+"&origPassword="+encodeURIComponent(transpassword);
}以下是html页面,我在<body>中加了
<base target="_self">然后是连接
<div id="original" align="center" style="display:none"><span style=" text-align:center; font-size:12px;">密码仍然是初始化密码,请点击<a href="#" onclick="test1();">修改密码</a>,之后再登录!</span></div>这个连接点击后,总是弹出新窗口,如何能不弹出新窗口呢?谢谢大家指点

解决方案 »

  1.   

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
    </head>
    <body>
        
        <div>
        <a href="#" onclick="test()" >123</a>
        </div></body>
    </html>
    <script>
     function test()
     {
        this.location.href="http://163.com";
     }
    </script>
      

  2.   

    这个加到<base target="_self"/>head中试试 
      

  3.   

    看了下,是模态窗口的问题,用下面方法看看..
    父窗<html xmlns="http://www.w3.org/1999/xhtml" >
        <head>
            <title>无标题页</title>
            <script language="javascript">
                function openwin(url)
                {
                    //打开模式窗口,注意模式窗口的样式
                    var arg=new Object();//传递进去的参数
                    arg.win=window;//把当前窗口的引用当参数传进去
                    var mydata=showModalDialog(url,arg,"dialogWidth:300px;dialogHeight:120px;center:yes;help:No;status:Yes;resizable:Yes;edge:sunken");
                }
            </script>
        </head>
        <body>
            <input id="Button1" type="button" value="打开窗口" onclick='openwin("c.html")' />
        </body>
    </html>模态窗 c.html<html xmlns="http://www.w3.org/1999/xhtml" >
        <head>
            <title>标题页</title>
            <script language=javascript>
                function ReturnWin()
                {
                    var arg=window.dialogArguments;
                    arg.win.openwin("http://www.baidu.com");            }
            </script>
        </head>
        <body>
            <input id="Button1" type="button" value="跳转" onclick="ReturnWin()" />
        </body>
    </html>