How do I get the BlackBerry OS version via javascript or jquery in a Webworks app?
I tried the following code from a thread "detect blackberry os version" but it isn't working for me:
var limit = '4.5.0.127';
var version = /BlackBerry\w+\/([\d\.]+)/i.exec(navigator.userAgent);
if (version[1] && version[1] < limit) {
location.href='notcompatible.cfm';
}
If you have experienced trouble detecting BlackBerry 10 (as I did after reading this answer!), be aware that the user agent string has changed in BB10, as explained in http://devblog.blackberry.com/2012/08/blackberry-10-user-agent-string/
In my specific case, I wanted to check if the version was just BB10, for which the next code is enough:
based on this document...
http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-to-detect-the-BlackBerry-Browser/ta-p/559862