我正试图点击一个链接打开一个新窗口。这提交了表单,应该打开目标中定义的窗口。 我成功地使用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响应。) 我在这里做错了吗?
答案 0 :(得分:0)
可以这么简单吗?
<form action="demo_form.php" method="get" target="_blank">