如何从父窗口的到子窗口的关闭事件? winid=window.open("test.htm")<button onclick="winid.close()">关闭这个子窗口</button> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 son.htm<body onunload=opener.yourfun()>father.htm<script>function myopen(){childwin=window.open("son.htm","sub","");}function yourfun(){alert("ok");}</script><body onload=myopen()> <html><head><script>function fnOpen(){ test=window.showModalDialog("showModalDialog_target.htm", "", "")}</script></head><body onload=fnOpen()>showModelDialog??<button onclick=javascript:function(){timer=setTimeout(test(),10)}>Click</button><script>function test(){ if (test.returnValue) clear(timer); else alert("stopped");}</script><body></html>代码还不是很有效,先帖上来,有空再研究一下. 转一个类似的<script language=javascript>function findwindow(wH){ if(wH.closed) { alert("窗口已关闭"); window.clearInterval(oInterval); }}wH=window.open('http://www.google.com'); </script><body onload=oInterval=window.setInterval("findwindow(wH)",1000);> JavaScript图片集效果代码 文字从左到右滚动!! 制作动态菜单遇到的问题,求救 jquery find()和children()的作用? 初学javascript,大家帮我看看这个dom小例子 js 操作frame 求大神指导,如何对网页视频播放器进行画面截取~ [求助]script里面包含JS文件 什么是“服务器端编译的javascript”? 有谁知道“email网页给朋友”怎样来实现? 急问 为什么我的输入框无法reset?(关于.htc)
<body onunload=opener.yourfun()>father.htm
<script>
function myopen()
{
childwin=window.open("son.htm","sub","");
}
function yourfun()
{
alert("ok");
}
</script>
<body onload=myopen()>
<script>
function fnOpen(){
test=window.showModalDialog("showModalDialog_target.htm", "",
"")
}</script>
</head>
<body onload=fnOpen()>showModelDialog??
<button onclick=javascript:function(){timer=setTimeout(test(),10)}>Click</button>
<script>
function test(){
if (test.returnValue) clear(timer);
else alert("stopped");
}
</script>
<body>
</html>
代码还不是很有效,先帖上来,有空再研究一下.
function findwindow(wH)
{
if(wH.closed)
{
alert("窗口已关闭");
window.clearInterval(oInterval);
}
}
wH=window.open('http://www.google.com');
</script>
<body onload=oInterval=window.setInterval("findwindow(wH)",1000);>