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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
New Developer
crwblyth
Posts: 28
Registered: ‎05-05-2011
My Carrier: T-Mobile
Accepted Solution

Push every href link to PlayBook browser.

I know how to invoke the browser to load a website, but let's say;

 

I'm using an RSS feed and the content contains href links. How do I push all of those links to load in the browser instead of in app?

I've tried various work arounds but still cannot seem to make it function.

 

Help appreciated,

Crwblyth 

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 839
Registered: ‎04-12-2010
My Carrier: Bell

Re: Push every href link to PlayBook browser.

[ Edited ]

Hello Crwblyth,

 

Once the <a> elements are loaded, my thought is that you would need to override the behaviour of the onclick (to invoke your JavaScript implementation of browser invoking), and also likely set the href attribute to "#" to prevent the default URL from taking any action.

 

HTML5 has querySelector and querySelectorAll (depending on your needs) implementations for you to get easier access to, for instance, all the anchor elements.

 

Let me know if you have any questions.

 

Erik Oros

BlackBerry Development Advisor

Please note that I will be unavailable between May 19th and June 4th. Sincere apologies for any delays during this time. I will do my best to follow-up as soon as I am able.

Erik Oros
BlackBerry Development Advisor
@WaterlooErik
Please use plain text.
New Developer
callumcarolan
Posts: 9
Registered: ‎03-10-2012
My Carrier: N/A

Re: Push every href link to PlayBook browser.

[ Edited ]

I did it like this

 

 

$('a').click(function(e){
e.preventDefault();
href = $(this).attr('href');
var args = new blackberry.invoke.BrowserArguments(href);
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
return false;
});

Please use plain text.