Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
Posts: 32
Registered: ‎10-07-2008
My Device: Not Specified

Blackberry Browser Javascript question ?

[ Edited ]

HI 

 

I need to redirect the user, if my application is requested from the BB browser.

 

This javascript works fine if the Javascript is enabled in their browser. If not how can i alert them saying "Enable Javascript" or something ?

 

if(navigator.userAgent.indexOf("BlackBerry")!=-1) {
window.location="http://xyz.com"
}

 

 Any ideas ?

 

 

 

Message Edited by oreyraj on 09-17-2009 10:09 AM
Developer
Posts: 52
Registered: ‎07-17-2008
My Device: Not Specified

Re: Blackberry Browser Javascript question ?

I don't do much HTML/Javascripting nowadays but have you tried using a <noscript/> tag?
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Blackberry Browser Javascript question ?

are you developing your own browser? or you're referring to the RIM Browser?
New Developer
Posts: 32
Registered: ‎10-07-2008
My Device: Not Specified

Re: Blackberry Browser Javascript question ?

[ Edited ]

Thanks for your reply,

 

I tried <noscript>Please enable javascript </noscript> but doesn't seems to work.

 

@johnbibs 

 

Yes i am referring to the RIM's BB browser .

 

 

Message Edited by oreyraj on 09-17-2009 10:31 AM
New Developer
Posts: 32
Registered: ‎10-07-2008
My Device: Not Specified

Re: Blackberry Browser Javascript question ?

Ok, <noscript> tag works, but every time i need to clear the cache content to take the effect means

 

1. Javascript enabled - BB browser redirects fine

 

2. Javascript disabled - not redirecting 

 

3. cleared cache and refreshed and then noscript tag works.

 

is this how the BB browser works ? I tried adding the content "No-cache" in the header section but still dont work Smiley Sad

Contributor
Posts: 12
Registered: ‎01-12-2011
My Device: Not Specified

Re: Blackberry Browser Javascript question ?

I'm on a BB 9700 and having this very same issue. No amount of cache clearing or refreshing seems to get the NOSCRIPT tag to work for us. Running OS 5.0.0.405
Highlighted
Contributor
Posts: 12
Registered: ‎01-12-2011
My Device: Not Specified

Re: Blackberry Browser Javascript question ?

It looks like it works for devices that haven't hit the test domain yet. However, for those of us that already hit the domain, no amount of cache clearing, hard resetting, reloading, or renaming the pages allows us to get the noscript to work on our 9700s (the only physical devices we have). Anyone ran into this before?