1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

保存一段代码,留着以后备用

本帖由 laogui2006-09-07 发布。版面名称:前端开发

  1. laogui

    laogui Administrator
    管理成员

    注册:
    2005-08-30
    帖子:
    15,216
    赞:
    35
    HTML:
    <script type="text/javascript">
    function checkBrowser() 
    { 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0; 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.mac=(this.ver.indexOf('Mac') > -1) ?1:0; 
    this.ope=(navigator.userAgent.indexOf('Opera')>-1); 
    this.ie=(this.ie6 || this.ie5 || this.ie4) 
    this.ns=(this.ns4 || this.ns5) 
    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope) 
    this.nbw=(!this.bw) 
    return this; 
    } 
    var s=checkBrowser();
    if(s.ns) 
    {
       alert('系统检测到您现在使用的是FireFox类型的浏览器, \n 为能得到更好的播放效果, 请您切换到 IE 浏览器下使用.');
       window.close();
    }
    </script>
     
  2. xiaohaa

    xiaohaa New Member

    注册:
    2006-01-08
    帖子:
    2,302
    赞:
    11
    谢了。。找它N久了:D