I want to target all blackberry devices do some device specific changes. Following is the code I have written which obviously dosen’t work. Thanks.
<script type="text/javascript">
var isMobile = {
BlackBerry: function() {
var ua = "BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179";
return navigator.ua.match(/^BlackBerry[0-9]*/) ? true : false;
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i) ? true : false;
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
}
};
if( isMobile.BlackBerry() ) {
$('body').css('background','green');
$('div.send-to-friend-form').css('display', 'block');
$('a#add_body_hidden').hide();
}
EDIT: I got the answer and is working already. I will post it in few days when stackoverflow allows me to do so.
I wrote a function that answers the questions and worked for me.