⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 8-3 弹窗行为检测.htm

📁 JAVASCRIPT完全自学手册,中源码的验证修订实例
💻 HTM
字号:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title>8-3  弹窗行为检测</title>
<!-- 样式表 -->
<style>
* { font-size:12px; font-family:宋体, Arial; font-weight:normal; color:#333; } /*规定了所有的字体样式*/
</style>
<!-- 脚本部分 -->
<script>
try{
    var newWin = window.open("http://www.google.cn","_blank","width=240, height=180, top=0, left=0, scrollbars=no, status=yes, toolbar=no, menubar=no, resizable=no");
    if(!newWin)throw(new Error("弹出窗口被拦截"));
    document.write("新窗口打开成功!");
}catch(e){
    document.write("打开新窗口时检测到一个错误<br>");
    document.write("错误的描述为" + e.description + "<br>");
    document.write("<a href=\"javascript:window.open('http://www.google.cn','_blank','width=240, height=180, top=0, left=0, scrollbars=no, status=yes, toolbar=no, menubar=no, resizable=no');void(0);\">单击此处打开一个新窗口</a>");
}
</script>
</head>
<body style="overflow:auto;">
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -