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.

Retrieving system information using JSWrt object in Symbian Web Runtime

From 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 10:58.
47 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.

×