Why does JQuery.browser.version return 1.9.1.2 for Firefox 3.5.2

隐身守侯 提交于 2020-01-04 04:08:06

问题


Does anybody know why JQuery.browser.version returns 1.9.1.2 for Firefox 3.5.2

What's the pattern? How to detect major versions?

navigator.userAgent
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"

 navigator.appVersion
"5.0 (Macintosh; en-US)"

回答1:


Apparently jQuery reports the version of the Gecko rendering engine




回答2:


Possibly not the answer you're looking for, but you may be better off not be checking for browser versions anyway - instead, check for supported features. Otherwise, you may be excluding browsers that do not support a certain feature now, but may well do so in the future.

Did you look at jQuery.support?




回答3:


1.9.1.2 is the version number of the Gecko layout engine used in Firefox 3.5.2. This information is likely more useful to you than the Firefox version number itself, as it will give you an idea of the browser's supported features .




回答4:


Anything based on the userAgent is unreliable. userAgent strings can be forged to look like something else or even just filled with garbage.

Test for the presence of functionality, not browser makers or browser versions.



来源:https://stackoverflow.com/questions/1398962/why-does-jquery-browser-version-return-1-9-1-2-for-firefox-3-5-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!