自写简单JS判断是否已经弹出页面
自写简单JS判断是否已经弹出页面
发布时间:2016-12-30 来源:查字典编辑
摘要:代码如下:复制代码代码如下:无标题文档vartest=0;functiontestShowWindow(){//禁用了activex控件你就...

代码如下:

复制代码 代码如下:

<!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="#"><input type="button" name="" value="弹出窗口"></a>

<body>

</body>

</html>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新Javascript教程学习
热门Javascript教程学习
编程开发子分类