04-02-2012 10:32 AM
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
Solved! Go to Solution.
04-02-2012 04:39 PM - edited 04-02-2012 04:40 PM
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
04-02-2012 04:46 PM - edited 04-02-2012 04:47 PM
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_BRO
return false;
});