showModalDialog()方法本来就是打开一个新窗口
ie7是标准的。
如果要在本窗口打开<a herf="..." target="_self">here</a>

解决方案 »

  1.   

    LS理解有误LZ说的是 在模态窗口中 试试在链接中加 target="_self" 
      

  2.   

    没有用的,在 showModalDialog() 里的所有链接,不管你怎么设置都是新开窗口的,你若确实要在模态框里加载新页面,可以采用asp.net的postback机制,用form表单做。
      

  3.   

    对话框里套一层iframe就可以了<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>JK:支持民族工业,尽量少买X货</title>
    <script language=javascript srcccccc="CommonJSFunction.js">
    /**
    * This function is to submit a form to ModalDialog.
    * JK 2007-03-06
    */
    function submitToModalDialog(formObj,dialogTitle,sFeatures){
    var dialogArguments=new Array();
    dialogArguments["src"]=null;
    dialogArguments["title"]=dialogTitle;
    dialogArguments["form"]=formObj;
    return showModalDialog("DialogFrame.htm",dialogArguments,sFeatures);
    }
    </script>
    </head><body>
    <form name="frm0" action="a.jsp">
    <input type=button value =DialogFrame onclick="var a=new Array();a['src']='a.jsp';window.showModalDialog('DialogFrame.htm',a);"/><br/>
    <input name=q><input type=button value =DialogFrame onclick="submitToModalDialog(this.form,'JK','');"/><br/>
    </form>
    <hr/>
    </body></html>----------------------------Dialog frame
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script language=javascript>
    var DialogArgument=window.dialogArguments;
    //The following code exists for :IE 6 can not change dialog title.
    if (DialogArgument!=null) document.write("<title>"+DialogArgument.title+"</title>");
    else document.write("<title>Dialog</title>");
    </script>
    <title>Dialog</title>
    </head>
    <body leftMargin=0 rightMargin=0 topMargin=0 bottomMargin=0 onload="initFun();" scroll=no> 
    <iframe name="dialogFrame" src="blank.html" width=100% height=100% id=dialogIframe></iframe>
    <form name="dialogForm" method="post" action="" target="dialogFrame" style="display:onne;">
    </form>
    </body>
    </html>
    <script language=javascript>
    function initFun()
    {
    if (DialogArgument!=null){
    if(DialogArgument.form!=null){
    var argForm=DialogArgument.form;
    var tempForm=document.dialogForm;
    tempForm.action=argForm.action;
    var argFormElements=argForm.elements;
    for(var i=0;i<argFormElements.length;i++){
    tempForm.insertAdjacentHTML("beforeEnd",argFormElements[i].outerHTML);
    }
    tempForm.submit();
    }
    else{
    document.dialogForm.action=DialogArgument.src;
    document.dialogForm.submit();
    }
    }
    else alert("useDialogFrameWrong");
    }
    </script>
      

  4.   

    传说中的 <base target="_self">
      

  5.   

    貌似只有套层框架才行~
    模态框里打开新的链接肯定会弹出新的窗口的,除非用SUBMIT递交页面跳转到别的页面里~
      

  6.   

    Note   Versions of Internet Explorer prior to Windows Internet Explorer 7 would allow the base element to appear anywhere in the document tree, which caused relative paths to use the "nearest" base element as the base for the URL. Internet Explorer 7 strictly enforces the use of the base tag within the head of the document, and will ignore misplaced tags.在IE7之前的版本中base元素允许出现在文档的任何地方. 并且一最近的一个元素发挥作用.
    但IE7强制base标签必须出现在head标签中间.这个是msdn的解释 不知道有没有用
      

  7.   

    楼上说的确是事实,以前我朋友一个页面用框架很正常,在IE7就不正常了,后来发现把base标签放在head的其它地方都不正常,所以在IE7用base target标签一定要放在head区才有效。但楼主说的问题只有像大家说的用iframe来解决,在A标签里设置target没用的。
      

  8.   

    我刚遇到LZ这问题而找到这里。我把<base   target= '_self '>放在<head>下作为第一个元素就没有问题了
      

  9.   

    IE7对标签的验证是非常严格的,以前随便写的<base target="_self"/>必须如下<head>
    <title>标题</title>
    <base target="_self"/>
    ...
    </head>
    否则就不会有效。切记切记!