论坛首页 Web前端技术论坛

父页面监听弹出页面关闭信息

浏览 2576 次
该帖已经被评为隐藏帖
作者 正文
   发表时间:2010-07-01  
父页面:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>

       <title>test
       </title>
    </head>
    <body>
   
<input type="text"  name="txtvalue" id="txtvalue">
<input type="text"  name="bbbb" id="bbb" value="helloworld">

<input type="button" name="btnOpen" value="open" id="btnOpen" onclick="aaa()"/>
    
    </div>
    </body>

<script language=javascript >
//var timer
var winOpen
function IfWindowClosed() {
if (winOpen.closed == true) {
  document.getElementById("txtvalue").value="abcd";
//window.clearInterval(timer)
}
}
function aaa(){

     document.getElementById("txtvalue").value=""

winOpen= window.open('page.html')

timer=window.setInterval("IfWindowClosed()",500);

}


</script>
</html>
弹出页面
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title></title>
<script>
window.opener.document.getElementById("bbb").value="xxx"
</script>
</head>
<body>
<h1>close me</h1>
</body>
</html>
   发表时间:2010-07-08  
这个为什么,能上技术首页呢?
0 请登录后投票
   发表时间:2010-07-08  
都很奇怪能上首页,另外就是排版也不用代码标记排下整个很乱
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics