62,046
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<a href="javascript:;" id="a">TEST</a>
<script type="text/javascript">
(function(){
var handle,dispose=function(){
window.clearInterval(handle);
};
var child;
document.getElementById("a").onclick = function(){
dispose();
child = window.open('http://www.zhaixiaowai.com/JSCompress/','test','width=800,height=400,top=100,left=200');
handle = window.setInterval(function(){
var hasclose;
try{
hasclose=!child||!child.top||child.closed;
}catch(ex){hasclose=true;}
if(hasclose){
dispose();
child=null;
alert("child has been closed");
}
},1000);
};
})();
</script>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<a href="javascript:;" id="a">TEST</a>
<script type="text/javascript">
(function(){
var handle,dispose=function(){
window.clearInterval(handle);
};
var child;
document.getElementById("a").onclick = function(){
dispose();
child = window.open('http://www.zhaixiaowai.com/JSCompress/','test','width=500,height=400,top=100,left=200');
handle = window.setInterval(function(){
var hasclose;
try{
hasclose=!child||!child.top;
}catch(ex){hasclose=true;}
if(hasclose){
dispose();
alert("child has been closed");
}
},1000);
};
})();
</script>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<a href="javascript:;" id="a">TEST</a>
<script type="text/javascript">
(function(){
var handle,dispose=function(){
window.clearInterval(handle);
};
var child;
document.getElementById("a").onclick = function(){
dispose();
child = window.open('http://www.zhaixiaowai.com/JSCompress/','test','width=500,height=400,top=100,left=200');
handle = window.setInterval(function(){
if(!child||!child.top){
dispose();
alert("child has been closed");
}
},1000);
};
})();
</script>
</body>
</html>