×
Namespaces

Variants
Actions

Retrieving system information using JSWrt object in Symbian Web Runtime

From Nokia Developer Wiki
Jump to: navigation, search

This code snippet shows what data can be obtained through the little-known JSWrt object, a part of the widget object in WRT1.1.

Article Metadata
Tested with
Devices(s): Nokia N97, Nokia N97 Mini, Nokia 5800 XpressMusic, Nokia 6710 Navigator
Compatibility
Platform(s): S60 5th Edition, S60 3rd Edition FP2
Article
Keywords: widget.wrt
Created: User:Kbwiki (29 Dec 2009)
Last edited: hamishwillee (06 May 2013)

Contents

JSWrt object

JSWrt object structure, properties, and sample return values:

  • widget
    • wrt [JSWrt]
      • version
        • On devices using Browser 7.0, 1.1 is returned. On devices using Browser 7.1, browser version number is returned (for instance, BrowserNG/7.1.13841).
      • platform [JSWrtPlatform]
        • id
          • Platform identifier S60
        • romVersion
          • SW version and product type v 31.0.008 24-8-2009 RM-365 (C) NMP
        • manufacturer
          • Phone manufacturer Nokia
        • packageVersion
          • on 7.0 browser 7.00(0) and on 7.1 browser 7.01(0)
        • model
          • Phone model N97

Sample code

Required HTML elements

 <pre><div id="stdOut"></div></pre>

Required JavaScript code

Before accessing the JSWrt object, check if it exists by using the typeof operator.

	if(typeof widget.wrt == 'object'){..}
function init()
{
if(typeof widget.wrt == 'object'){
 
writelog(widget.wrt.version);
writelog(widget.wrt.platform.id);
writelog(widget.wrt.platform.romVersion);
writelog(widget.wrt.platform.manufacturer);
writelog(widget.wrt.platform.packageVersion);
writelog(widget.wrt.platform.model);
}
}
 
function writelog(text){
document.getElementById("stdOut").innerHTML += text +"<br/>";
}
This page was last modified on 6 May 2013, at 13:58.
41 page views in the last 30 days.
×