js如何判断浏览器是不是360类型

JavaScript09

js如何判断浏览器是不是360类型,第1张

代码如下:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   

  

<html>  

  <head>  

    <base >  

      

    <title></title>  

    

    <script>  

        function bro(){  

            var is360 = false  

            var isIE = false  

            if (window.navigator.appName.indexOf("Microsoft") != -1){  

                isIE= true  

            }  

            if(isIE&&(window.navigator.userProfile+'')=='null'){  

                is360 = true  

            }  

            if(is360){  

                document.body.innerText = '360浏览器'  

            }else if(isIE){  

                document.body.innerText = 'IE浏览器'  

            }  

        }  

    </script>  

  </head>  

    

  <body onload="bro()">  

     

  </body>  

</html>

function whatBrowser()

{

document.Browser.Name.value=navigator.appName

document.Browser.Version.value=navigator.appVersion

document.Browser.Code.value=navigator.appCodeName

document.Browser.Agent.value=navigator.userAgent

if (window.navigator.userAgent.indexOf('compatible') != -1) {

alert('360兼容模式')

}

if(window.navigator.userAgent.indexOf('AppleWebKit') != -1) {

alert('360极速模式')

}

}