禁止某种平台或浏览器访问

<script type="text/javascript">
  //浏览器版本不支持跳转
  var isMobileTest="";
  var browserName = $.client.browserVersion.browser;             //浏览器名称
  var browserVersion = parseInt($.client.browserVersion.version);//浏览器版本
  var osVersion=$.client.version;                                //操作系统版本
  var browserOS=$.client.os;
  
  function accessFilter(){
      //禁止iphone、ipad、android访问
      // if(browserName!="IE"){
      //     window.location.href="/wui/common/page/sysRemind.jsp?labelid=-1";
      //     return ;
      // }
      if(isMobileTest!="1"&&(browserOS=="iPhone/iPod"||browserOS=="iPad"||browserOS=="Android")){
         window.location.href="/wui/common/page/sysRemind.jsp?labelid=2&browserOS="+browserOS;
         return ;
      }   
      //禁止windows下safari访问   
      if((browserName == "Safari"&&browserOS=="Windows")){   
       //  window.location.href="/wui/common/page/sysRemind.jsp?labelid=3&browserOS="+browserOS+"&browserName="+browserName; 
        // return ;
      }   
      if((browserName == "FF"&&browserVersion<9)||(browserName == "Chrome"&&browserVersion<14)||(browserName == "Safari"&&browserVersion<5&&browserOS!="Windows")){
            window.location.href="/wui/common/page/sysRemind.jsp?labelid=1&browserName="+browserName+"&browserVersion="+$.client.browserVersion.version;
            return ;
      }
      //禁止IE8以下浏览器访问,并提示安装IE8
      if(browserName == "IE"&&browserVersion<8&&!document.documentMode){
         window.location.href="/wui/common/page/sysRemind.jsp?labelid=4";
         return ;
     }
      
  }
  
  accessFilter();
  
</script>
<script language='javascript'>document.title='虎彩协同办公平台';</script>

 

posted @ 2019-04-28 14:46  终究是乌云遮了天  阅读(777)  评论(0编辑  收藏  举报