12-06-2012 03:09 AM
Hi,
I am trying to open the web browser in BB10 using invoke and Browser arguments as specified in the following link:
https://developer.blackberry.com/html5/apis/blackb
https://developer.blackberry.com/html5/apis/blackb
My code:js
function openBrowser() {
alert('in open browser');
console.log('in open browser');
var args = new blackberry.invoke.BrowserArguments('http://www.google.com');
blackberry.invoke.invoke(blackberry.invoke.APP_BRO WSER, args);
}My html:
<script id="browse" src="js/browse.js"></script> <div id="foo" data-bb-type="context-menu"> <div data-bb-type="action" data-bb-img="images/actionBar/cog_dark_theme.png" onclick="openBrowser();"> OPEN BROWSER </div> </div>
But i get the following error:
Uncaught TypeError: undefined is not a function browse.js:5 openBrowser browse.js:5 onclick
Where am I going wrong.
Regards,
Annuk
12-06-2012 06:35 AM
for BB10 must use blackberry.invoke like this
https://developer.blackberry.com/html5/apis/blackb
invoke a link you do this
function openWebLink() {
// open web link - allows the system to choose an appropriate target that handles http://
blackberry.invoke.invoke({
uri: "http://www.blackberry.com"
}, onInvokeSuccess, onInvokeError);
}
12-06-2012 07:57 AM
Hi,
Thanks for your reply. Tried as you said.
When I run it in Ripple I get the following alert, but it does not open the url in a browser. Is it not possible to open the url in a browser in ripple.
Requested to invoke external application with the following arguments: uri = http://www.blackberry.com
Regards,
Annuk