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
>
查看全文
相关阅读:
G a+b+c+d=?
H Kuangyeye and hamburgers
python 实现加法
高精度板子
angular项目一
angular大牛的博客
autocomplete
angular的 表单
快捷方式控制台调试each这种方法的时候怎么停
自己练习的一些应该熟记的代码
原文地址:https://www.cnblogs.com/chenbg2001/p/1704097.html
最新文章
BZOJ 1046: [HAOI2007]上升序列
BZOJ 1090: [SCOI2003]字符串折叠
BZOJ 1090: [SCOI2003]字符串折叠
BZOJ 1044: [HAOI2008]木棍分割
BZOJ 1044: [HAOI2008]木棍分割
bzoj 2716 [Violet 3]天使玩偶——KDtree
bzoj 1941 [Sdoi2010]Hide and Seek——KDtree
bzoj 2044 三维导弹拦截——DAG最小路径覆盖(二分图)
bzoj 2648 SJY摆棋子——KDtree
bzoj1018 [SHOI2008]堵塞的交通traffic——线段树
热门文章
bzoj2002 [Hnoi2010]Bounce 弹飞绵羊——分块
bzoj3631 [JLOI2014]松鼠的新家——树上差分
bzoj3668 [Noi2014]起床困难综合症——贪心
bzoj1878 [SDOI2009]HH的项链——树状数组
bzoj1861 [Zjoi2006]Book 书架——splay
bzoj1047 [HAOI2007]理想的正方形——二维单调队列
bzoj1007 [HNOI2008]水平可见直线——单调栈
洛谷P4141 消失之物——背包
洛谷P2943 清理——DP
J Less taolu
Copyright © 2011-2022 走看看