target和window open在IE中不能一起工作

target and window open not working together in IE

本文关键字:不能 一起 工作 IE window open target      更新时间:2023-09-26

单击链接后,我正试图打开一个新窗口。这将提交表单,并应打开目标中定义的窗口。我在chrome和FF中做得很成功,但在IE中没有。
以下是我的代码:

  <form name="myForm" id="myForm" method="get" action="${URL_DOCUMENT}">
<table border=1 cellpadding=1 width="50%" style='table-layout: fixed'
  id="table1">
    <thead>
        <tr>
              <th align='left'>Statement Date</th>
        </tr>
    </thead>
  <tbody>
        <c:forEach var="statement" items="${list}">
              <tr>
                    <td><a href="" onclick="return callSubmit(this)">
                    <c:out value="${statement.date}" /> <img
                          src='/images/dat.png'
                          alt="" style="border-style: none"> </a></td>
              </tr>
        </c:forEach>
  </tbody>
</table>
<input type="hidden" name="key" id="key" value="" /></form>
<script type="text/javascript">
function callSubmit(link){
  var test =link.innerHTML.split("<");
  document.getElementById("key").value = test[0]; 
  var w =  window.open('','newDocWin','width=500,height=300,titlebar=no,toolbar=no,location=no'); 
 document.getElementById('myForm').submit();
 return false;
 }
 </script>

在IE 2中,窗口被打开了。我定义的窗口和另一个(不确定它从哪里来)。在chrome和FF中,它运行良好(PDF响应在定义的窗口中)我在这里做错了什么吗

它能这么简单吗?

 <form action="demo_form.php" method="get" target="_blank">