07-31-2012 03:27 PM
I'm just wrapping a mobile web link into a tablet app. So basically, the app shows the web URL page defined in config.xml. I want to add naviagation menu item like back and forward button, anyone knows how to do it?
Any way I could write some codes to make it just like a simple browser which links to a URL by default?
Thanks!
Kevin
Solved! Go to Solution.
07-31-2012 05:30 PM
You can have links or buttons using the following code:
Forward:
href="javascript:history.go(-1)">
Back:
href="javascript:history.go(1)"
You can use onclick="" as well if you'd prefer.
07-31-2012 05:47 PM
07-31-2012 06:00 PM
Webworks doesn't give any good way to include an external Page that I'm aware of.
You might be able to use an iframe or embed the mobile webpage, and include navigation as well. However, the site owner could very easily block that (and may already have done so).
You can use child.browser, but it will not be BB10 compatible because it's based on flash.
Is the webpage static? The best option would be to simple include the HTML and js files within the app.
07-31-2012 06:14 PM
07-31-2012 06:17 PM
07-31-2012 06:22 PM
07-31-2012 06:44 PM - edited 07-31-2012 06:47 PM
Instructions are at https://developer.blackberry.com/html5/apis/blackb
It looks as if the API just changed (I haven't tested the new function) but you have a javascript command that you call with onclick.
Untested (by me) sample:
function openWebLinkInBrowser() {
// open web link in browser
blackberry.invoke.invoke({
target: "sys.browser",
uri: "http://www.blackberry.com"
});
}
<img src="image.png" onclick="openWebLinkInBrowser()" />
07-31-2012 07:05 PM