欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

自写简单JS判断是否已经弹出页面

程序员文章站 2023-12-13 14:23:10
代码如下: 复制代码 代码如下:
代码如下:
复制代码 代码如下:

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<script language="javascript1.2" type="text/javascript1.2">
var test=0;
function testshowwindow()
{
//禁用了activex控件你就不记录哈
if(test)
{
if(!test.closed){
alert('窗口弹出了');
test.close();
}else{
alert('没有弹出噶');
}
}
//这个你加到 没有弹出时再弹出看看呢
test = window.open('http://sc.jb51.net','test','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width=400,height=600,left=100,top=100');
//这里你可以记录哈 (可在弹出时记录)
}
</script>
</head>
<body>
<a href="#" onclick="javascript:testshowwindow();"><input type="button" name="" value="弹出窗口" onclick="javascript:testshowwindow();"></a>
<body>
</body>
</html>
相关标签: 弹出页面

上一篇:

下一篇: