检测浏览器的js
2008-07-22 10:57
323 查看
CheckBrowser.js
--------------------------------------------------------------------
<!--
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
//ΪIE
//setActiveStyleSheet("default.css");
}
else
{
if (window.navigator.userAgent.indexOf("Firefox")>=1)
{
//ΪFirefox
//alert("ʹõΪFirefox ڼ⣬ʹIE");
alert("The browser you use is Firefox. Because of compatibility, please use IE.");
location.href="javascript:window.close()";
}
else
{
//Ϊ
//alert("ʹõIE ڼ⣬ʹIE");
alert("The browser you use is not IE. Because of compatibility, please use IE.");
location.href="javascript:window.close()";
}
}
//-->
--------------------------------------------------------------------
<!--
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
//ΪIE
//setActiveStyleSheet("default.css");
}
else
{
if (window.navigator.userAgent.indexOf("Firefox")>=1)
{
//ΪFirefox
//alert("ʹõΪFirefox ڼ⣬ʹIE");
alert("The browser you use is Firefox. Because of compatibility, please use IE.");
location.href="javascript:window.close()";
}
else
{
//Ϊ
//alert("ʹõIE ڼ⣬ʹIE");
alert("The browser you use is not IE. Because of compatibility, please use IE.");
location.href="javascript:window.close()";
}
}
//-->
相关文章推荐
- JS----检测各浏览器及版本
- navigator,JS检测浏览器插件
- navigator,JS检测浏览器插件
- JS 检测浏览器中是否安装了特定的插件
- js检测按键的跨浏览器解决方案
- 用js实现的检测浏览器和系统的函数
- js检测关闭页面或浏览器
- js 检测浏览器版本
- adblockTester通过js检测用户浏览器是否安装了AdBlock
- JS笔记:检测客户端(引擎、浏览器、平台、操作系统)
- js检测浏览器的版本并给出提示
- js浏览器各种位置检测
- javascript dectect browser 检测浏览器js
- JS笔记:检测客户端(引擎、浏览器、平台、操作系统、移动设备)
- 浏览器检测-js
- JavaScript高级程序设计阅读笔记(十六) javascript检测浏览器和操作系统-detect.js
- js检测IE8及一下浏览器版本并做出提示
- js检测浏览器版本、核心、是否移动端示例
- js检测浏览器版本