zoukankan
html css js c++ java
JavaScript 强行弹出窗口 与 无提示关闭页面
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
>
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=gb2312"
/>
<
title
>
无标题文档
</
title
>
<
script
type
="text/javascript"
>
/**/
/*
*
* 定义ForceWindow类构造函数
* 无参数
* 无返回值
*/
function
ForceWindow ()
{
this
.r
=
document.documentElement;
this
.f
=
document.createElement(
"
FORM
"
);
this
.f.target
=
"
_blank
"
;
this
.f.method
=
"
post
"
;
this
.r.insertBefore(
this
.f,
this
.r.childNodes[
0
]);
}
/**/
/*
*
* 定义open方法
* 参数sUrl:字符串,要打开窗口的URL。
* 无返回值
*/
ForceWindow.prototype.open
=
function
(sUrl)
{
this
.f.action
=
sUrl;
this
.f.submit();
}
/**/
/*
*
* 实例化一个ForceWindow对象并做为window对象的一个子对象以方便调用
* 定义后可以这样来使用:window.force.open("URL");
*/
window.force
=
new
ForceWindow();
window.force.open(
"
http://163.com
"
)
/**/
/*
*
* 用本程序弹出的窗口将不会被广告拦截软件拦截,但有一个缺点:你无法象对window.open弹出的窗口那样对外观进行定制。
* 你当然也可以在使用前实例化一个ForceWindow对象:
* var myWindow = new ForceWindow();
* 这样来使用:网页教学网http://www.webjx.com
* myWindow.open("URL");
* 本程序测试通过的浏览器:IE 5+、Firefox 1.0、Mozilla 1.7.5、Netscape 7.2、Opera 7.23
* 友情提示:如果你将本程序用于强制弹出广告,请更多的想想浏览者的感受!
*/
<!--
强制关闭
-->
window.opener
=
"
meizz
"
;
window.close();
</
script
>
</
head
>
<
body
>
</
body
>
</
html
>
查看全文
相关阅读:
查看网站上保存的密码
前端图片预览
Amaze UI的一点总结
简单实现图片验证码
获取网页数据的例子
谈谈网页中的ajax
网页小技巧-360doc个人图书馆复制文字
Js中的4个事件
网页页面蒙版实现
Spring+SprinMVC配置学习总结
原文地址:https://www.cnblogs.com/kingboy/p/1007344.html
最新文章
MySQL查询in操作 查询结果按in集合顺序显示
python学习笔记(0)python基础概念
python学习笔记(8)迭代器和生成器
python学习笔记(6)数据类型-集合
python学习笔记(5)数据类型-字典
python学习笔记(4)数据类型-元组
python学习笔记(2)数据类型-字符串
python学习笔记(3)数据类型-列表list
python学习笔记(1)python数据类型
postman接口测试使用
热门文章
HDU 4883 TIANKENG’s restaurant
HDU 1062 Text Reverse(水题,字符串处理)
HDU 2204 Eddy's爱好(容斥原理)
HDU 4858 项目管理(邻接表 暴力模拟)
codeforces 258div2C Predict Outcome of the Game
codeforces 258div2 B Sort the Array
codeforces 258div2 A Game With Sticks(DP)
HDU 4864 Task (贪心+STL多集(二分)+邻接表存储)(杭电多校训练赛第一场1004)
HDU 4857 Couple doubi(找循环节)
HDU 1018 Big Number (数学题)
Copyright © 2011-2022 走看看