vote.jsp<%@page language="java" contentType="text/html;charset=GBK"%>
<link href="../style.css" rel="stylesheet" type="text/css" />
<table width="153" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="237" background="../image2/investigate_1.jpg"><table width="92%" border="0" align="center" cellpadding="0" cellspacing="2">
<form name="votefrm" method="post" action="../vote/writor.jsp" target="_blank">
<tr>
<td height="10"></td>
</tr>
<tr>
<td align=center><input type=submit value="投 票">
<input name="button" type=button onClick="javascript:window.open('../vote/writor.jsp')" value="查 看"></td>
</tr>
</form>
</table></td>
</tr>
</table>
writor.jsp:
<html><body onload="window.open ('vote.jsp', 'newwindow', 'height=450, width=680, top=200, left=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no, blackcolor=ffffff');opener=null; window.close(); "></body></html>把两个文件放在vote文件夹就可以测试,当点投票就要提示关闭,点查看就不提示,不知道什么原因?
<link href="../style.css" rel="stylesheet" type="text/css" />
<table width="153" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="237" background="../image2/investigate_1.jpg"><table width="92%" border="0" align="center" cellpadding="0" cellspacing="2">
<form name="votefrm" method="post" action="../vote/writor.jsp" target="_blank">
<tr>
<td height="10"></td>
</tr>
<tr>
<td align=center><input type=submit value="投 票">
<input name="button" type=button onClick="javascript:window.open('../vote/writor.jsp')" value="查 看"></td>
</tr>
</form>
</table></td>
</tr>
</table>
writor.jsp:
<html><body onload="window.open ('vote.jsp', 'newwindow', 'height=450, width=680, top=200, left=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no, blackcolor=ffffff');opener=null; window.close(); "></body></html>把两个文件放在vote文件夹就可以测试,当点投票就要提示关闭,点查看就不提示,不知道什么原因?
function closeWindow(){
window.opener='xxx';//可以是任何值
window.close();
}当要关闭的窗口是通过别的窗口中的脚本打开时,可以直接关闭,不提示
这里就是要造出这种假相