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. Thanks for all your past and future contributions.

Archived:Use prototype JavasSript library - basic operations (utility functions, etc) in Symbian Web Runtime

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Code ExampleCompatibility
S60 3rd Edition FP2
Created: dougcn (19 Mar 2008)
Last edited: hamishwillee (02 Jul 2012)



As you may know, Prototype is a famous cross-web-browser javascript library. It supports almost all current popular web browsers, such as FireFox, Safari, IE, Opera, etc. With the latest version(Prototype 1.6.0), it also supports AppleWebKit, an open source web engine provided by Apple Inc.

The Nokia Web Browser is built upon S60WebKit, a port of the open source WebKit project to the S60 platform. Nokia WRT(Web-RunTime) is based on it.

In this section, we will see how to do basic operations(utility functions) using prototype library[1].

Basic operations (Utility functions, etc)

Here is a list of the basic operations (dollar functions) provided by prototype library:

  • $() -- returns the element that has the id passed as an argument
  • $$() -- returns the elements that match CSS selectors
  • $A() -- converts the single argument it receives into an Array object.
  • $F() -- returns the value of any field input control
  • $H() -- converts objects into enumerable Hash objects that resemble associative arrays
  • $R() -- builds a range object.
  • $w() -- Splits a string into an Array, treating all whitespace as delimiters. Equivalent to Ruby's %w{foo bar} or Perl's qw(foo bar).

For detailed explanations of these functions, please go to

All of the above functions are tested in the example WRT application of this topic. For the convenience, the related source code of each test case is displayed in UI, and formatted by prettyprint.js for a better look.

All test cases of the above functions passed. The Try.these function is not tested, you can try it yourself.

Most of the examples(cases) come from this guidance: (You may notice this guide is a note for prototype1.5.0, but it doesn't matter.)

The next topic will be String manipulations.

Download Sample Widget

Download sample wiget of this topic: To install it, just rename the suffix .zip to .wgz.

For the latest version, please go to

Related topics


  • Prototype javascript Home Page [2]
  • Use prototype [3]
  • Sample WRT applications Download [4]
This page was last modified on 2 July 2012, at 04:15.
67 page views in the last 30 days.