通过用户代理黑莓设备的分类 [英] Classification of Blackberry devices by using useragent
问题描述
我需要根据操作系统版本的BlackBerry设备进行分类。
I need to classify blackberry devices based on OS version.
如果BB5和BB6然后{做到这一点}
if BB5 and BB6 then {do this}
如果BB7和上方,然后{做到这一点}
if BB7 and above then {do this}
我知道,
BB 5用户代理是这样的:
I knew, BB 5 useragent looks like this :
BlackBerry9700 / 5.x.x.x资料/ MIDP-2.1配置/ CLDC-1.1厂商ID / 229
BB 6起,用户代理是:
BB 6 onward useragent is :
的Mozilla / 5.0(黑莓手机; U;黑莓9800; ZH-TW)为AppleWebKit / 534.1 +(KHTML,例如Gecko)版本/ 6.x.x.x移动版Safari / 534.1 +
那么,如何能归类5和6和7&放大器;上述
So, How can i classify 5&6 and 7&above?
推荐答案
开放源代码的检测移动浏览器脚本可能是你在找什么。
The open source Detect Mobile Browsers script may be what your looking for.
在访问该网页,其中还包含链接下载脚本的形式过多,它会告诉你通过一个活生生的例子相关的信息。
When visiting that webpage, which also contains the links to download the script in a plethora of formats, it will show you the relevant information via a live example.
在我的桌面PC这不是一个移动设备,我收到此信息:
On my desktop PC which isn't a mobile device, I receive this info:
否手机浏览器检测。
的Mozilla / 5.0(Windows NT的5.1; RV:12.0)的Gecko / 20100101火狐/ 12.0
http://detectmobilebrowsers.com/
的 P.S。如果你使用该脚本注布尔真正或假的变量是使用(即,使用 !! 变量名测试前假)。的
P.S. If you do use that script note Boolean true or false on the variable is to be used (i.e., use !! before variable name to test for false).
下面是我完成的,因此您可以与BlackBerry设备测试的jsfiddle例子。
http://jsfiddle.net/sPBrL/4/
Here is jsfiddle example that I completed so you can test with your Blackberry Device.
http://jsfiddle.net/sPBrL/4/
这篇关于通过用户代理黑莓设备的分类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!