firefox/ie
function isIE()
{
if(document.all)
{
return true;
}
else
{
return false;
}
}
ie6/ie7
if(document.all){
if (window.XMLHttpRequest) {
document.write("IE7");
}else{
document.write("<IE7");
}
}
ie/mathon:
if(window.navigator.userAgent.indexOf("Maxthon")>-1)
{
}
检测浏览器类型与版本
本文提供了一种简单的方法来检测用户的浏览器类型及版本,包括Internet Explorer(IE)、Firefox和其他使用了Maxthon引擎的浏览器。通过JavaScript代码判断浏览器特性,帮助开发者进行针对性的网页优化。
824

被折叠的 条评论
为什么被折叠?



