如何判断,子画面对父画面进行了刷新操作,
我在一个画面上弹出自画面
然后再子画面,作window.opener.location.reload()
因为父画面在onload 中作了个window.focus()
所以刷新后父画面走到最前端,
现在我要子画面害是最前端该怎么做,
麻烦各位了,急啊,有分加
问题点数:100、回复次数:4Top
1 楼xjdawu(无法界定)回复于 2005-06-01 10:21:54 得分 30
var childWin = null;
function aa() {
... ...
childWin = windown.open("a.htm","","")
... ...
}
<body onload="if(childWin == null) window.focus()">Top
2 楼wyhkgd(自由天神)回复于 2005-06-01 10:23:00 得分 20
主页页
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<script language="javascript">
<!--
window.focus(); //这里有window.focus();
//-->
</script>
<a href="#" onclick="javascript:window.open('b.htm')">开新页</a>
</body>
</html>
新窗口页面:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>刷新主窗口</title>
</head>
<body>
<script language="javascript">
<!--
function re()
{
window.opener.location.reload();
window.focus(); //刷新后再把子窗口设置为window.focus();即可
}
//-->
</script>
<a href="#" onclick="re()">刷新主窗口</a>
</body>
</html>
Top
3 楼fantiny(卖身不卖艺的菜鸟)回复于 2005-06-01 10:27:22 得分 20
子画面调用window.opener.location.reload(),前设置一下setInterval(),多少秒focus回来。Top
4 楼meizz(梅花雪)回复于 2005-06-01 10:34:14 得分 30
showModalDialog('ttt.htm', window,'dialogWidth: 480px; dialogHeight: 360px; status: no; help: no');
if (window.dialogArguments != null)
var mm = window.dialogArguments;
mm.location.reload(); //用模态框可保证子页面永远在最前面Top




