添加IE6用户升级的提示

  SynaKyra博客今天增加了一个功能,提示IE6用户进行升级。

  经常访问国外知名网站(如Twitter、Facebook等)的网友都知道,很多网站都有提示IE6及以下用户更换浏览器的提示。IE6不支持当今的互联网标准,成为阻碍互联网创新的主要障碍。此外,大多做网页的站长也会觉得IE6比较讨厌,因为写网页还要专门为IE6的兼容性加不少东西。

  此方法来自于可能吧的提醒,效果如图:

 

  如果有想在自己网站添加代码的朋友,请往下看。

在</body>之前加入以下代码:

<!--[if lte IE 6]>
<script src="http://www.你的网站地址.com/killie6.js"></script>
<![endif]-->

在网站根目录创建killie6.js文件,添加以下内容:

/**
* Let's kill Internet Explorer 6
*
* Copyright (c) 2009 NeoEase (http://www.neoease.com/)
* Licensed under the GPL licenses:
* http://www.gnu.org/licenses/gpl.html
*
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(e(){2 c=0;2 I=Z;2 10=7;2 j=\'J\';2 K=\'L\';2 11=\'k://J.1w.l/1x/1y/m.1z.12\';2 13=-1A;2 14=\'<3 9="J"><3 4="15"></3><3 4="16"></3><3 4="A"></3><3 4="A"></3><3 4="1B"><a n="r" 9="M" g="">1C</a><17 4="1D"></17>
<p>您正在使用 N O 6 浏览网页,如果您<B>升级到 N O 8</B> 或<B>转换到另一个浏览器</B>,本站将能为您提供更好的服务。</p>
<3 4="18"></3><p 4="1E"><a n="r" 4="1F" g="k://t.1G.l/1H/1I-1J/">1K 8</a><a n="r" 4="1L" g="k://t.1M.l/">1N</a><a n="r" 4="19" g="k://t.19.l/">1O</a><a n="r" 4="1a" g="k://t.1P.l/1a/">1Q</a><a n="r" 4="1b" g="k://t.1R.l/1b/">1S</a><3 4="18"></3></p><p 4="1T">1U\\\'s 1c N O 6, <a g="k://t.1V.l/1W-1c-1X/">1Y 1Z 21 22</a>.</p></3><3 4="A"></3><3 4="A"></3><3 4="16"></3><3 4="15"></3></3>\';e d(v,w,P){h(1d w!=\'1e\'){h(1d Q!=\'1e\'&&Q!=R){P=Q}h(w===R){w=\'\'}2 C=\'\';D=23 24();D.25(D.26()+(P*27));C=\'; C=\'+D.28();2 1f=\'\';2 1g=\'\';2 1h=\'\';b.d=[v,\'=\',29(w),C,1f,1g,1h].2a(\'\')}2b{2 S=R;h(b.d&&b.d!=\'\'){2 T=b.d.2c(\';\');1i(2 i=0;i<T.x;i++){2 d=T[i];2d(d.2e(0)==\' \'){d=d.U(1,d.x)}h(d.U(0,v.x+1)==(v+\'=\')){S=2f(d.U(v.x+1));2g}}}V S}}e y(9){2 1j=b.o(9);1j.m.2h=(b.1k.2i+b.1k.2j+13)+\'2k\';2l(\'q.y("\'+9+\'")\',Z)}e 1l(9){2 f=b.o(9);c=0;f.m.W=\'X(c=\'+c+\')\';f.m.1m=\'2m\';E=1n(\'q.F("\'+9+\'")\',2n)}e 1o(9){2 f=b.o(9);E=1n(\'q.G("\'+9+\'")\',20)}e F(9){2 f=b.o(9);c+=5;h(c>=I){c=I;1p(E)}f.m.W=\'X(c=\'+c+\')\'}e G(9){2 f=b.o(9);c-=5;h(c<=0){c=0;1p(E);f.m.1m=\'2o\'}f.m.W=\'X(c=\'+c+\')\'}e 1q(f){z.2p(f.g)}e 1r(1s){2 Y=b.1t("Y")[0];2 u=b.2q(\'2r\');u.2s=\'2t/12\';u.n=\'2u\';u.g=1s;u.2v=\'2w\';Y.2x(u)}h(d(j)!=K){1r(11);b.2y(14);2 1u=b.o(\'M\');1u.1v=e(){1o(j);d(j,K,10);V L};2 H=b.o(j).1t(\'a\');1i(2 i=0;i<H.x;i++){h(H[i].9!=\'M\'){H[i].1v=e(){1q(2z);V L}}}1l(j);y(j)}z[\'q\']={};z[\'q\'][\'F\']=F;z[\'q\'][\'G\']=G;z[\'q\'][\'y\']=y})();',62,160,
'||var|div|class|||||id||document|opacity|cookie|function|obj|href|if||targetId|http|com|style|rel|getElementById||HKIE6|nofollow||www|cssNode|name|value|length|float|window|r1|strong|expires|date|tid|fadeIn|fadeOut|links|maxOpacity|letskillie6|flag|false|letskillie6_close|Internet|Explorer|day|LETSKILLIE6_DELAY|null|cookieValue|cookies|substring|return|filter|alpha|head|100|delay|cssUrl|css|offset|html|r4|r2|span|fixed|opera|chrome|safari|kill|typeof|undefined|path|domain|secure|for|target|documentElement|show|display|setInterval|hide|clearTimeout|popup|loadCss|url|getElementsByTagName|closeButton|onclick|googlecode|svn|trunk|zh|165|content|Close|pic|browsers|ie8|microsoft|windows|internet|explorer|IE|firefox|mozilla|Firefox|Opera|google|Chrome|apple|Safari|meta|Let|neoease|lets|ie6|insert|on||your|website|new|Date|setTime|getTime|86400000|toUTCString|encodeURIComponent|join|else|split|while|charAt|decodeURIComponent|break|top|scrollTop|clientHeight|px|setTimeout|block|40|none|open|createElement|link|type|text|stylesheet|media|screen|appendChild|write|this'.split('|'),0,{}))

Syna 发表于 2009-9-29 类别: 「互联网络」 | 标签: ,

若未注明,本博客文章均为原创,转载请以链接形式标明本文地址
本文地址:http://skday.com/archives/271/

3条留言 立即发表评论

  1. #2看客 China 360浏览器 Windows @ 2011-11-12 22:14 回复

    我说是这样的。

  2. #1流水有情 China Internet Explorer Windows @ 2010-5-1 15:50 回复

    博客又如何加入这一代码呢?请博主移步我的博客给予指导!

    • Syna China Mozilla Firefox Windows @ 2010-5-2 00:04 回复

      刚刚从外面回来,发现你现在已经成功做到了~恭喜了呵呵

评论


 ≮本博客已开启垃圾留言过滤,留言人工审核≯  在评论中显示个性头像>>

无觅相关文章插件,快速提升流量