Contents |
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].
Here is a list of the basic operations (dollar functions) provided by prototype library:
For detailed explanations of these functions, please go to http://prototypejs.org/api/utility
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: http://www.sergiopereira.com/articles/prototype.js.html (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 wiget of this topic: File:PrototypeBasicDemo.zip. To install it, just rename the suffix .zip to .wgz.
For the latest version, please go to http://code.google.com/p/prototypewrt/downloads/list