skyangell

页面关闭时弹出广告

<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  那时花开  阅读(248)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2021-12-20
  • 2021-04-19
  • 2021-12-06
  • 2021-11-05
  • 2021-08-15
  • 2022-01-02
  • 2022-01-01
  • 2021-09-08
猜你喜欢
  • 2021-12-10
  • 2021-12-20
  • 2022-01-02
  • 2021-08-05
  • 2021-11-27
  • 2021-12-23
  • 2021-12-20
相关资源
相似解决方案