惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
小众软件
小众软件
腾讯CDC
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
Y
Y Combinator Blog
Engineering at Meta
Engineering at Meta
美团技术团队
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
罗磊的独立博客
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements

博客园 - 那时花开

VS2012 快捷键 VS Resharper 设置 TFS2012 独占签出实现 WinForm 生产环境、测试环境 多配置-App.config(分享) TFS2010 服务器名称变更bug 怎样和客户一起搞定需求 MSMQ XP 0x433 430 错误处理 ajax 同步异步模式问题 asp.net membership 配置错误 Test Concurrent 本地安全策略 脚本 在asp.net 3.5中sql 2005数据库缓存依赖 关于 p3p ie 跨域 问题 jQuery插入,复制、替换和删除节点 jquery 常用方法整理 存储过程生成代码 sql2000版 It 人大多路线图 收集常用数据库设计技巧 PowerDesigner 常用设置 mssql 数据库文档生成
页面关闭时弹出广告
那时花开 · 2011-03-30 · via 博客园 - 那时花开

<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>

用心对待身边的一切,一切皆有可能!

发表于 2011-03-30 01:08  那时花开  阅读(285)  评论()    收藏  举报