Namespaces
Variants
Actions

Opening a web page into Web browser from Symbian Web Runtime

Jump to: navigation, search

This code snippet demonstrates how to open a web page into Web browser from Symbian Web Runtime.

Article Metadata

Code Example
Tested with
Devices(s): Nokia 5800 XpressMusic, Nokia 6220 Classic

Compatibility
Platform(s): S60 5th Edition, S60 3rd Edition FP2

Article
Keywords: widget.openURL()
Created: dekuykin (26 Feb 2009)
Last edited: hamishwillee (04 Oct 2012)

Contents

Source: Relevant HTML components

<div id="bodyContent" class="bodyContent">
<label for="url">URL</label>
<input id="url" type="text" value="http://" size="16"
maxlength="256" />
 
<input id="openButton" type="button" value="Open"
onclick="executeSnippet();" />
</div>

Source

// Executes the snippet.
// Loads the HTML page whose URL is entered into the widget's input label.
function executeSnippet() {
// Get the URL of the specified HTML page
var url = document.getElementById('url').value;
 
// Encode the URL string
var urlEncoded = encodeURI(url);
 
// Open the HTML page
widget.openURL(urlEncoded);
}

Postconditions

The HTML page whose URL is entered in the widget's input label is opened in Web browser.

Supplementary material

This code snippet is part of the stub concept, which means that it has been patched on top of a template application in order to be more useful to developers. The version of the WRT stub application used as a template in this snippet is v1.1.

This page was last modified on 4 October 2012, at 09:02.
535 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

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