我这里没有问题啊?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
<!--
var previewWindow;
function doPreview(){
    if(previewWindow == null){
      previewWindow = window.open("","Preview","width=160,height=480,scrollbars=yes");
    }else if(previewWindow.closed == true){
      previewWindow = window.open("","Preview","width=160,height=480,scrollbars=yes");
    }
    var doc   = document.myForm;
    doc.target = previewWindow.name;
    doc.action = "Noname4.html";
    doc.submit();
    previewWindow.focus();
  }
//-->
</SCRIPT></HEAD>
<FORM METHOD=POST ACTION="" name ="myForm">
<input type="button" onclick="doPreview()" value= "preview">
</FORM>
<BODY></BODY>
</HTML>

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var previewWindow;
    function doPreview(){
        if(previewWindow == null){
          previewWindow = window.open("","Preview","width=160,height=480,scrollbars=yes");
        }else if(previewWindow.closed == true){
          previewWindow = window.open("","Preview","width=160,height=480,scrollbars=yes");
        }
        var doc   = document.myForm;
        doc.target = previewWindow.name;
        doc.action = "Noname4.html";
        doc.submit();
        previewWindow.focus();
      }function doProperty(){
        var doc = document.myForm;
        doc.action = "Property.jsp";
        doc.submit();
    }
    //-->
    </SCRIPT></HEAD>
    <FORM METHOD=POST ACTION="" name ="myForm">
    <input type="button" onclick="doPreview()" value= "preview">
    <input type="button" onclick="doProperty()" value= "link">
    </FORM>
    <BODY>
    </BODY>
    </HTML>
    页面中利用此方法弹出previewWindow窗口后,主页面的link连接窗口也变成了弹出窗口。
    不知道问题出在哪里,请高手指点.
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var Preview;
    function doPreview(){
        Preview = window.open("","Preview","width=160,height=480,scrollbars=yes");
        var doc   = document.Form;
        doc.target = Preview.name;
        doc.action = "Preview.html";
        doc.submit();
        Preview.focus();
      }function doProperty(){
        var doc = document.myForm;
        doc.action = "Property.html";
        doc.submit();
    }
    //-->
    </SCRIPT>
    </HEAD>
    <FORM METHOD=POST ACTION="" name ="myForm">
    <input type="button" onclick="doPreview()" value= "preview">
    <input type="button" onclick="doProperty()" value= "link">
    </FORM>
    <BODY>
    </BODY>
    </HTML>
    窗口名改了也不行啊,继续在线求救!!
      

  3.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var Preview;
    function doPreview(){
        Preview = window.open("","Preview","width=160,height=480,scrollbars=yes");
        var doc   = document.myForm;
        doc.target = Preview.name;
        doc.action = "Preview.html";
        doc.submit();
        Preview.focus();
      }function doProperty(){
        var doc = document.myForm;
        doc.action = "Property.html";
        doc.submit();
    }
    //-->
    </SCRIPT>
    </HEAD>
    <FORM METHOD=POST ACTION="" name ="myForm">
    <input type="button" onclick="doPreview()" value= "preview">
    <input type="button" onclick="doProperty()" value= "link">
    </FORM>
    <BODY>
    </BODY>
    </HTML>
    最新的测试代码,请高手指点,在线等待
      

  4.   

    try
    ------------------
    doc.target = ""  //本窗口
    doc.target = window //新窗口