复制代码 代码如下:
<script type="text/javascript">
/*详细方法1*/
function CheckBrowser()
{
var app=navigator.appName;
var verStr=navigator.appVersion;
//火狐浏览器
if (app.indexOf('Netscape') != -1)
{
alert("你使用的是Netscape浏览器或火狐浏览器。");
}
else if (app.indexOf('Microsoft') != -1)
{
if (verStr.indexOf("MSIE 3.0")!=-1 || verStr.indexOf("MSIE 4.0") != -1 || verStr.indexOf("MSIE 5.0") != -1 || verStr.indexOf("MSIE 5.1") != -1)
{
alert("您使用的是低版本(IE6.0以下)的浏览器.");
}
else
{
alert("您使用的是IE6.0以上的浏览器.");
}
}
}
/*简洁方法2*/
function CheckBrowser1()
{
if (window.navigator.userAgent.indexOf("MSIE")>=1)
//如果浏览器为IE
{
alert("IE浏览器");
}
else //如果浏览器为Firefox
{
if (window.navigator.userAgent.indexOf("Firefox")>=1)
{
alert("Fixfox浏览器");
}
}
}
//调用
CheckBrowser();
CheckBrowser1();
</script>
JavaScript 获取 客户端信息
复制代码 代码如下:
document.write("Screen resolution: ")
document.write(screen.width + "*" + screen.height)
document.write("<br />")
document.write("Available view area: ")
document.write(screen.availWidth + "*" + screen.availHeight)
document.write("<br />")
document.write("Color depth: ")
document.write(screen.colorDepth)
document.write("<br />")
document.write("Buffer depth: ")
document.write(screen.bufferDepth)
document.write("<br />")
document.write("DeviceXDPI: ")
document.write(screen.deviceXDPI)
document.write("<br />")
document.write("DeviceYDPI: ")
document.write(screen.deviceYDPI)
document.write("<br />")
document.write("LogicalXDPI: ")
document.write(screen.logicalXDPI)
document.write("<br />")
document.write("LogicalYDPI: ")
document.write(screen.logicalYDPI)
document.write("<br />")
document.write("FontSmoothingEnabled: ")
document.write(screen.fontSmoothingEnabled)
document.write("<br />")
document.write("PixelDepth: ")
document.write(screen.pixelDepth)
document.write("<br />")
document.write("UpdateInterval: ")
document.write(screen.updateInterval)
document.write("<br />")
您可能感兴趣的文章:
- JSP中实现判断客户端手机类型并跳转到app下载页面
- js根据手机客户端浏览器类型,判断跳转官网/手机网站多个实例代码
- Javascript中获取浏览器类型和操作系统版本等客户端信息常用代码
- js获取客户端操作系统类型的方法【测试可用】
- JavaScript学习笔记之检测客户端类型是(引擎、浏览器、平台、操作系统、移动设备)
- Javascript实现检测客户端类型代码封包
- 利用JS判断客户端类型你应该知道的四种方法
转载请注明出处:http://www.sjzxcyzs.com/article/20230402/53862.html