当前位置:
首页 >
页面关闭时弹出广告
发布时间:2023/12/18
33
豆豆
<head >
<title>关闭时弹出页demo,暂时支持ie版本</title>
<script type="text/javascript">
var G_Event;
function OpenUrl(url) {
document.getElementById("palyer").launchURL(url);
}
function Init() {
document.write("<object id='palyer' width='0' height='0' classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'></object>");
}
function BeginClose() {
window.open("http://www.baidu.com"); //广告方式
OpenUrl("http://www.baidu.com"); //window player 方式
}
window.onmousemove = function(e) {
G_Event = e ? e : window.event;
}
window.onbeforeunload = function(e) {
e = window.event ? window.event : G_Event;
if (window.event) { //ie
if (e.clientY < 0 || e.altKey) {
BeginClose();
} else {
//ie刷新
}
}
else {
BeginClose();
}
}
</script>
<script>
//必须的
Init();
</script>
</head>
<body>
</body>
<title>关闭时弹出页demo,暂时支持ie版本</title>
<script type="text/javascript">
var G_Event;
function OpenUrl(url) {
document.getElementById("palyer").launchURL(url);
}
function Init() {
document.write("<object id='palyer' width='0' height='0' classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'></object>");
}
function BeginClose() {
window.open("http://www.baidu.com"); //广告方式
OpenUrl("http://www.baidu.com"); //window player 方式
}
window.onmousemove = function(e) {
G_Event = e ? e : window.event;
}
window.onbeforeunload = function(e) {
e = window.event ? window.event : G_Event;
if (window.event) { //ie
if (e.clientY < 0 || e.altKey) {
BeginClose();
} else {
//ie刷新
}
}
else {
BeginClose();
}
}
</script>
<script>
//必须的
Init();
</script>
</head>
<body>
</body>
转载于:https://www.cnblogs.com/skyangell/archive/2011/03/30/1999356.html
总结
- 上一篇: new TypeToken<List>>
- 下一篇: E4X 完全攻略