IE版本低提示再加加cookie时效

2018-01-22  本文已影响0人  小夕夕丨梦林

<!--[if lt IE 9]>

    <script type="text/javascript">

function setCookie(c_name,value,expiredays){

var exdate=new Date()

exdate.setTime(exdate.getTime()+expiredays)

document.cookie=c_name+ "=" +escape(value)+

((expiredays==null) ? "" : ";expires="+exdate.toGMTString())

}

function getCookie(c_name){

if (document.cookie.length>0){

c_start=document.cookie.indexOf(c_name + "=")

if (c_start!=-1){

c_start=c_start + c_name.length+1

c_end=document.cookie.indexOf(";",c_start)

if (c_end==-1) c_end=document.cookie.length

return unescape(document.cookie.substring(c_start,c_end))

}

}

return ""

}

var ck=getCookie('ck');

var url='libraryplay.php?cid=<?=$channel_id?>&nid=<?=$nid?>';

        var str = "您的IE浏览器版本太低了 :(";

        var str2 = "推荐使用:谷歌、火狐、百度等浏览器!<br><br>"+

"或者升级IE到最新版本!";

if(ck!="66"){

document.writeln("<pre style='text-align:center;color:#fff;background-color:#87CEFA; height:100%;border:0;position:fixed;top:0;left:0;width:100%;z-index:1234'>" +

"<h2 style='padding-top:200px;margin:0'><strong>" + str + "<br/></strong></h2><h2>" + str2 + "</h2><h2><strong><a href='resource/bdbrowserSetup-8.7.exe' target='_blank' style='color:blue;'>百度浏览器</a></h2><h2 ><a href='resource/IE11_for_Win7_x64.exe' target='_blank' style='color:blue;'>IE11_64位浏览器</a></h2><h2 ><a href='resource/IE11_for_Win7x86.exe' target='_blank' style='color:blue;'>IE11_32位浏览器</a></strong></h2><h2><a href='"+url+"' >继续浏览</a><h2></pre>");

setCookie('ck','66',120000);

document.execCommand("Stop");

}

    </script>

<![endif]-->

上一篇 下一篇

猜你喜欢

热点阅读