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
Contributor
reng2012
Posts: 36
Registered: ‎02-04-2012
My Device: None
My Carrier: Break Wind

How to use menus to go to other webpages

I can't figure out how to use menus to go to other webpages. I have the following code:

 

function clickMe1(){
    window
.location ="what.html";
}
blackberry
.ui.menu.clearMenuItems();
var item =new blackberry.ui.menu.MenuItem(false,1,"What It Does", clickMe1);
blackberry
.ui.menu.addMenuItem(item);

 

But Ripple complains: "The requested URL /ripple/what.html was not found on this server."

 

What am I doing wrong??

Please use plain text.
Contributor
reng2012
Posts: 36
Registered: ‎02-04-2012
My Device: None
My Carrier: Break Wind

Re: How to use menus to go to other webpages

Okay, I found a solution. It's stupid that I have to do this, but I guess that's how the BlackBerry WebWorks universe swings.

 

var loc = window.location;

window.location = loc.protocol + "//" + loc.host + "/MyApp/what.html";

 

Please use plain text.