Toggle navigation

Step 2: Implement the widget functionality

AccuWidget source code contains an XHTML file, a CSS file, several plain text documents, several .png image files, and four JavaScript files:

  • common.js includes common content
  • dev_specific.js includes device-specific content
  • accuWidget.js and demo.js contain AccuWidget-specific functions

This step concentrates on implementing demo.js, which provides the menu functionality for AccuWidget. Use the following information to populate the demo.js file.

To initialize the widget and define the widget window, replace the functions in demo.js with the following code:

To create the widget menu, add the following function to the demo.js file:

To add the functionality for handling the menu item selections, add the following function to the demo.js file:

To enable the display of textual forecast, add the following function to the demo.js file:

The file demo.js is now prepared for use. In the next step you create the .wgz file for the widget.


Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2012 All rights reserved