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
Highlighted
Contributor
Posts: 23
Registered: ‎03-07-2013
My Device: Blackberry Z10
My Carrier: Vodafone
Accepted Solution

Open all URL in Browser

I am making a webworks app in which I have added advertisements When user clicks on ads instead of opening ads in browser it just opens in browser where there is no back bar..... not just ads almost all URLs when clicked instead of opening in browser they just open inside the app without back button
the same error is given by BFB team to me 
 
BFB Team Said
"When the app opens the IRCTC website link  through the ‘Register For IRCTC’ option, the user cannot return back to the app. Please add a button that enables user to return back to the app when the user access the IRCTC website through your app."
 
Please help me in solving it. I want that anyurl when clicked is opened in browser not within the app

 
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Open all URL in Browser

If you add:

target="_blank"

To your <a> elements, they will open in a Child Browser card, meaning it will display the content, but there will also be the option of closing the card. Does that satisfy your needs?

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Contributor
Posts: 23
Registered: ‎03-07-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: Open all URL in Browser

But sir what about advertisements? I what advertisement to also load with option to go back
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Open all URL in Browser

When an advertisement is loaded, you could retrieve the element and add the target attribute manually. Some advertising services will actually let you specify what sort of target you want associated with your ads.

For example:
var links = document.querySelectorAll('a');

Then loop through the links and:
links[n].setAttribute('target', '_blank');

* Or something along those lines.

There is no way to explicitly override all link elements in an app to open as a card; you'll need to take some manual intervention and modify the elements to behave as you want them to.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.