<script type=“text/javascript”>
function isIE(){
return navigator.appName.indexOf(“Microsoft Internet Explorer”)!=-1 && document.all;
}
function isIE6() {
return navigator.userAgent.split(“;”)[1].toLowerCase().indexOf(“msie 6.0″)==“-1″?false:true;
}
function isIE7(){
return navigator.userAgent.split(“;”)[1].toLowerCase().indexOf(“msie 7.0″)==“-1″?false:true;
}
function isIE8(){
return navigator.userAgent.split(“;”)[1].toLowerCase().indexOf(“msie 8.0″)==“-1″?false:true;
}
function isNN(){
return navigator.userAgent.indexOf(“Netscape”)!=-1;
}
function isOpera(){
return navigator.appName.indexOf(“Opera”)!=-1;
}
function isFF(){
return navigator.userAgent.indexOf(“Firefox”)!=-1;
}
function isChrome(){
return navigator.userAgent.indexOf(“Chrome”) > -1;
}
</script>
下面介紹下 js獲取客戶端瀏覽器信息
Navigator 對象包含有關瀏覽器的信息。js就是通過Navigator的屬性獲取客戶端瀏覽器信息
Navigator 對象屬性:
屬性
描述
appCodeName 返回瀏覽器的代碼名。
appMinorVersion 返回瀏覽器的次級版本。
appName 返回瀏覽器的名稱。
appVersion 返回瀏覽器的平台和版本信息。
browserLanguage 返回當前瀏覽器的語言。
cookieEnabled 返回指明瀏覽器中是否啟用 cookie 的布爾值。
cpuClass 返回瀏覽器系統的 CPU 等級。
onLine 返回指明系統是否處於脫機模式的布爾值。
platform 返回運行瀏覽器的操作系統平台。
systemLanguage 返回 OS 使用的默認語言。
userAgent 返回由客戶機發送服務器的 user-agent 頭部的值。
userLanguage 返回 OS 的自然語言設置。
function isIE(){
return navigator.appName.indexOf(“Microsoft Internet Explorer”)!=-1 && document.all;
}
function isIE6() {
return navigator.userAgent.split(“;”)[1].toLowerCase().indexOf(“msie 6.0″)==“-1″?false:true;
}
function isIE7(){
return navigator.userAgent.split(“;”)[1].toLowerCase().indexOf(“msie 7.0″)==“-1″?false:true;
}
function isIE8(){
return navigator.userAgent.split(“;”)[1].toLowerCase().indexOf(“msie 8.0″)==“-1″?false:true;
}
function isNN(){
return navigator.userAgent.indexOf(“Netscape”)!=-1;
}
function isOpera(){
return navigator.appName.indexOf(“Opera”)!=-1;
}
function isFF(){
return navigator.userAgent.indexOf(“Firefox”)!=-1;
}
function isChrome(){
return navigator.userAgent.indexOf(“Chrome”) > -1;
}
</script>
下面介紹下 js獲取客戶端瀏覽器信息
Navigator 對象包含有關瀏覽器的信息。js就是通過Navigator的屬性獲取客戶端瀏覽器信息
Navigator 對象屬性:
屬性
描述
appCodeName 返回瀏覽器的代碼名。
appMinorVersion 返回瀏覽器的次級版本。
appName 返回瀏覽器的名稱。
appVersion 返回瀏覽器的平台和版本信息。
browserLanguage 返回當前瀏覽器的語言。
cookieEnabled 返回指明瀏覽器中是否啟用 cookie 的布爾值。
cpuClass 返回瀏覽器系統的 CPU 等級。
onLine 返回指明系統是否處於脫機模式的布爾值。
platform 返回運行瀏覽器的操作系統平台。
systemLanguage 返回 OS 使用的默認語言。
userAgent 返回由客戶機發送服務器的 user-agent 頭部的值。
userLanguage 返回 OS 的自然語言設置。