原意是想在进入到页面A后,自动跳转到指定的B.jsf页面,有时(大概每五六次中会出现一次)会出现页面空白(即表现为无法响应)的现象,我做过试验,应该是在打开窗口后再关闭父窗口时有点问题,曾经在它们直接加入了setTimeout()方法,但是好像也没有办法,哪位能帮忙解决一下?页面A如下:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> 
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> 
<script language="javascript">
function click1()
{
var a = window.open("B.jsf","_blank");
a.opener.opener=null;
a.opener.close();
}
function init()
{
var obj=window.document.all("myform:comm");
obj.click();
}</script><html>
<body onload="init()">
<f:view>
<h:form id="myform">
<h:commandButton onclick="click1()" value="test" style="display:none" id="comm"/>
</h:form>
</f:view>
</body>
</html>