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
>
查看全文
相关阅读:
js事件的一些兼容写法
js数据劫持 Object.defineProperty() 作用
Java并发编程(三):ReentrantLock
Idea使用插件实现逆向工程搭建SpringBoot项目
Java并发编程(二):volatile关键字
Java并发编程(一):线程基础知识以及synchronized关键字
Docker快速上手之部署SpringBoot项目
JVM基础快速入门篇
linq 多表分组左连接查询查询统计
Expression表达式目录树
原文地址:https://www.cnblogs.com/kingboy/p/1007344.html
最新文章
What is the innovator’s solution——什么才是创新的解决方案2
What is the innovator’s solution——什么才是创新的解决方案1
Google Play市场考察报告-2
Google Play市场考察报告
【形式化方法:VDM++系列】4.VDM实战1——铁路费用计算
【形式化方法:VDM++系列】3.基于VDM++的图书管理系统需求定义
【漫画】读写锁ReadWriteLock还是不够快?再试试StampedLock!
【漫画】互斥锁ReentrantLock不好用?试试读写锁ReadWriteLock
【漫画】JAVA并发编程 J.U.C Lock包之ReentrantLock互斥锁
【漫画】JAVA并发编程 如何解决原子性问题
热门文章
【漫画】JAVA并发编程之并发模拟工具
【漫画】JAVA并发编程三大Bug源头(可见性、原子性、有序性)
git提交代码托管平台流程
前端常用设计模式
原生js实现图片瀑布流布局,注释超详细
构造函数继承与class继承
js闭包
let与var的区别
原生js ajax 封装
原生js实现点击添加购物车按钮出现飞行物飞向购物车
Copyright © 2011-2022 走看看