Join Our 3 MILLION+ Members Today! Register Here | Login
Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > App Developers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
    Thread Author   #1  
Old 05-01-2009, 12:58 PM
CrackBerry Newbie
Device(s): 8800
Carrier: AT&T/Cingular
 
Join Date: May 2009
Posts: 1
Likes Received: 0
Thanked 0 Times in 0 Posts
Default Javascript detect BlackBerry?

OK - so I have found a great simple script for detecting an iphone and redirecting - is there an equivalent for all blackberries?

<script language=javascript>
<!--
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))

{
location.href='linktonewurl';
}
-->

Thanks!
Reply With Quote Tip this Post
  #2  
Old 05-01-2009, 01:41 PM
Forums Moderator
Device(s): Pearl and Apple
Carrier: Rogers TalkSpot UMA
 
Location: Canada
Join Date: Dec 2007
Posts: 9,304
Likes Received: 24
Thanked 136 Times in 88 Posts
Default

Welcome to CrackBerry.

I have moved your thread to the developers subfourms, perhaps somebody can help you here.
__________________
Reply With Quote Tip this Post
  #3  
Old 05-02-2009, 10:31 PM
CrackBerry Abuser
Device(s): 9000 (Bold)
Carrier: Vodafone
 
Join Date: Oct 2008
Posts: 494
Likes Received: 0
Thanked 1 Time in 1 Post
Default

Yes, detect the Blackberry user agent.

The Blackberry browser can choose which user agent they wish to present to the server, so keep that in mind.
Reply With Quote Tip this Post
Reply
BlackBerry Forums at CrackBerry.com > > BlackBerry Professionals > App Developers   Javascript detect BlackBerry?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes