网页顶部显示IE版本过低的代码





  

今天有人让我注册 www.eagleworldwide.com域名,结果被人注册,顺便看看人家的网站

一进去,上面大半截就是提示IE版过低的广告窗口,而且只提示一次啊,我立刻兴趣就来了,发掘它的源码,如下:

XML/HTML代码
  1. /**   
  2.  * RokIEWarn - An IE6 Warning to invite people upgrading to IE6   
  3.  *    
  4.  * @version     1.2-noOpacity   
  5.  *    
  6.  * @license     MIT-style license   
  7.  * @author      Djamil Legato <djamil@rockettheme.com>  
  8.  * @client      RocketTheme, LLC.   
  9.  * @copyright   Author   
  10.  */   
  11.     
  12.     
  13. var RokIEWarn = new Class({   
  14.     'site': 'sitename',   
  15.     'initialize': function() {   
  16.         var warning = "<h3>You are currently browsing this site with Internet Explorer 6 (IE6).</h3><h4>NOTE: This template is compatible with IE6, however your experience will be enhanced with a newer browser.</h4><p>Internet Explorer 6 was released in August of 2001, and the lastest version of IE6 was released in August of 2004.  By continuing to run Internet Explorer 6 you are open to any and all security vulnerabilities discovered since that date.  In March of 2009, Microsoft released version 8 of Internet Explorer that, in addition to providing greater security, is faster and more standards compliant than both version 6 and 7 that came before it. The overall usage of Internet Explorer 6 has decreased to such a point that 2009 will probably be the year in which web developers stop supporting it, so please upgrade as soon as possible.  It's for your own good!</p> <br /><a class=\"external\"  href=\"http://www.microsoft.com/windows/internet-explorer/?ocid=ie8_s_cfa09975-7416-49a5-9e3a-c7a290a656e2\">Download Internet Explorer 8 NOW!</a>";   
  17.            
  18.         this.box = new Element('div', {'id': 'iewarn'}).inject(document.body, 'top');   
  19.         var div = new Element('div').inject(this.box).setHTML(warning);   
  20.            
  21.         var click = this.toggle.bind(this);   
  22.         var button = new Element('a', {'id': 'iewarn_close'}).addEvents({   
  23.             'mouseover': function() {   
  24.                 this.addClass('cHover');   
  25.             },   
  26.             'mouseout': function() {   
  27.                 this.removeClass('cHover');   
  28.             },   
  29.             'click': function() {   
  30.                 click();       
  31.             }   
  32.         }).inject(div, 'top');   
  33.            
  34.         this.height = $('iewarn').getSize().size.y;   
  35.            
  36.         this.fx = new Fx.Styles(this.box, {duration: 1000}).set({'margin-top': $('iewarn').getStyle('margin-top').toInt()});   
  37.         this.open = false;   
  38.            
  39.         var cookie = Cookie.get('rokIEWarn'), height = this.height;   
  40.         //cookie = 'open'; // added for debug to not use the cookie value   
  41.         if (!cookie || cookie == "open") this.show();   
  42.         else this.fx.set({'margin-top': -height});   
  43.   
  44.            
  45.         return ;   
  46.     },   
  47.        
  48.     'show': function() {   
  49.         this.fx.start({   
  50.             'margin-top': 0   
  51.         });   
  52.         this.open = true;   
  53.         Cookie.set('rokIEWarn', 'open', {duration: 7});   
  54.     },     
  55.     'close': function() {   
  56.         var margin = this.height;   
  57.         this.fx.start({   
  58.             'margin-top': -margin   
  59.         });   
  60.         this.open = false;   
  61.         Cookie.set('rokIEWarn', 'close', {duration: 7});   
  62.     },     
  63.     'status': function() {   
  64.         return this.open;   
  65.     },   
  66.     'toggle': function() {   
  67.         if (this.open) this.close();   
  68.         else this.show();   
  69.     }   
  70. });   
  71.   
  72. window.addEvent('domready', function() {   
  73.     if (window.ie6) { (function() {var iewarn = new RokIEWarn();}).delay(2000); }   
  74. });  
  





收藏到:添加到QQ书签 百度收藏 添加到鲜果 新浪ViVi 365Key网摘 天极网摘 我摘 和讯网摘 yahoo 收藏到收客网 Digbuzz我挖网 添加到饭否 挖客 添加到google

[本日志由 plus 于 2009-11-11 04:11 PM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: IE
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.