Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Opening a web page into Web browser from Symbian Web Runtime

From Wiki
Jump to: navigation, search

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

Article Metadata
Code ExampleTested with
Devices(s): Nokia 5800 XpressMusic, Nokia 6220 Classic
Compatibility
Platform(s): S60 5th Edition, S60 3rd Edition FP2
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 06:02.
98 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×