检查黑莓手机型号,操作系统版本的网页,JavaScript

检查黑莓手机型号,操作系统版本的网页,JavaScript


http://www.springworks.info/ota/check9930.html


结果:

检查黑莓手机型号,操作系统版本的网页,JavaScript_第1张图片


<script type="text/javascript">
    var ua = navigator.userAgent;
    if (ua.indexOf("BlackBerry") >= 0) {
        if (ua.indexOf("Version/") >= 0) { // ***User Agent in BlackBerry 6 and BlackBerry 7
			position = ua.indexOf("BlackBerry ") + 11;
			document.write("BlackBerry Model : " + ua.substring(position, position + 4) + "<br/>");
            
			position = ua.indexOf("Version/") + 8;
            document.write("BlackBerry OS Version : " +  ua.substring(position, position + 10) + "<br/>");
			
			position = ua.indexOf("Version/") + 8 + 6;
			bundle =  ua.substring(position, position + 3 );
			document.write("BlackBerry OS Version : " +  bundle + "<br/>");
			if (bundle < 649)
			 document.write("WARNING: please contact IT to upgrade BlackBerry OS. Otherwise you may experience international roam problem when you go abroad.");
			else
		     document.write("Thank you, your device need no upgrade.");
        }
        else {// ***User Agent in BlackBerry Device Software 4.2 to 5.0
            var SplitUA = ua.split("/");
			//document.write("Jorgesys BB OS Version :: " + SplitUA[1].substring(0, 3));
			document.write("You device is OS 4.2 - 5.0. " + ua);
        }
    }
</script>


你可能感兴趣的:(检查黑莓手机型号,操作系统版本的网页,JavaScript)