Monday, June 01, 2009

Tech Tip: extending the reach of your website

Hello,

If you already have a website, what is the simplest way to deploy it as a widget? Given the WRT api, you might be tempted to use the URL as an argument to widget.openURL(). This will go to the desired website but it will launch the web browser. This is a computationally expensive. Also, when the user exits the browser they will need to widget.

An alternative is

window.location = dist;

Now with one click, you can go to the website. If you run this widget, you'll notice a problem. There are no softkeys. Here is the code to fix that.

if (window.widget) {
menu.showSoftkeys();
}

-jk

0 comments: