|
Newsletters
|
|
|
|
|
The WMLScript Standard Libraries
While WMLScript does not support the creation of new objects via object-oriented programming, it does provide six "pre-built" libraries that aid in the handling of many common tasks. These libraries (with a brief description of each) include:
- Lang - This library contains a set of functions that are closely related to the WMLScript language core. Included in this library are functions for data type manipulation, absolute value calculations, and random number generation.
- Float - The Float library is optional and is only supported on those clients who have floating-point capabilities. Typical functions provided by this library include sqrt(), round(), and pow().
- String - The String library contains a set of functions for performing string operations. Some of the functions included in this library are length(), charAt(), find(), replace(), and trim().
- URL - This library contains a set of functions for handling both absolute URLs and relative URLs. Typical functions include getPath(), getReferer(), and getHost().
- WMLBrowser - This library contains functions by which WMLScript can access the associated WML context. These functions must not have any side effects and must return invalid in cases where the system does not support WMLBrowser and where the interpreter is not invoked by the WML Browser. Commonly used functions in this library include go(), prev(), next(), getCurrentCard(), and refresh().
- Dialogs - This library contains a set of typical user interface functions including prompt(), confirm(), and alert().
Next: Validating User Input Via WMLScript
|
|
|