如何使用JS检测浏览器版本? [英] How can I detect the browser version with JS?
本文介绍了如何使用JS检测浏览器版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用JS来检测操作系统版本,而不仅仅是操作系统类型.
I need to detect the OS version with JS not just the OS type.
这可能吗?
推荐答案
我在Firefox中的navigator.userAgent显示:
My navigator.userAgent in Firefox shows :
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6"
在Chrome中:
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.86 Safari/533.4"
在IE8中:
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.6
显然,对于我特定的OS/浏览器组合是可能的,但我真的不希望它在任何地方都能正常工作.
So apparently for my particular OS/Browsers combination is possible, but I would not really count on that working everywhere.
这篇关于如何使用JS检测浏览器版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文