Description
Wireless Markup Language Script (WMLS) is a procedural scripting language based on ECMAScript, but severely restricted to suit the limited capabilities of early WAP phones. It is designed to be embedded within WML decks to provide client-side scripting functionality. Unlike full JavaScript, WMLS has a minimal library and does not support dynamic document object model manipulation because WML is not DOM-based. Instead, WMLS scripts operate within the context of a WML card, manipulating variables, controlling navigation, and performing simple input validation.
WMLS works by being declared within a WML deck using the `<wmls>` element. The script code is compiled into a compact binary form (WMLScript bytecode) for transmission over the wireless network to the client device. The WAP gateway or the origin server may perform this compilation. On the client, the WML micro-browser includes a WMLScript interpreter. When a WML card that invokes a script is loaded, the interpreter executes the bytecode. Scripts can be called via URLs (e.g., `wmls://`) or triggered by events within the WML. Typical uses include checking the format of an input field before submitting it to the server, performing a simple arithmetic calculation locally, or controlling which card to display next based on user choice.
Key components of WMLS are the scripting language syntax and standard libraries (e.g., for string, float, dialog, and URL functions), the compiler that converts source to bytecode, and the interpreter in the client micro-browser. Its role in the network was to add a layer of intelligence and efficiency to WAP services. By allowing some processing to happen on the client, it reduced unnecessary network transactions (like submitting invalid data) and enabled more responsive user interfaces, making early mobile applications slightly more dynamic and user-friendly within the tight constraints of the technology.
Purpose & Motivation
WMLS was created to address a specific deficiency in the initial WAP 1.x specification, which only included the static content language WML. While WML could define forms and navigation, any logic—such as validating that a phone number field contained digits—required a round-trip to the server. This was inefficient on slow, high-latency wireless connections and led to a poor user experience. The purpose of WMLS was to introduce a safe, lightweight mechanism for client-side logic.
It solved the problem by providing a stripped-down scripting language that could run on the limited memory and CPU of mobile phones. The language was designed to be secure (no access to device hardware or file systems) and compact (both in source size and compiled bytecode). This enabled developers to create WAP applications that were more interactive and efficient, improving the usability of services like mobile banking, booking, or information portals. It extended the WAP platform's capabilities without requiring more powerful handsets or faster networks, bridging the gap until more advanced technologies like XHTML Mobile Profile and full JavaScript became viable on mobile devices.
Key Features
- ECMAScript-based syntax with restricted functionality for mobile devices
- Compilation to compact bytecode (WMLScript) for efficient transmission
- Standard libraries for string, float, dialog, URL, and WML browser functions
- Secure execution environment with no access to device resources
- Invocation via URLs or WML event bindings within a deck
- Enables client-side input validation, local calculations, and navigation control
Evolution Across Releases
WMLS was specified in 3GPP TS 23.057 as part of the MExE (Mobile Station Application Execution Environment) classmark 3 specifications. It defined the scripting language for enhancing WAP 1.x applications, providing the formal standard for client-side logic within the 3GPP service framework for advanced mobile terminals.
Defining Specifications
| Specification | Title |
|---|---|
| TS 23.057 | 3GPP TS 23.057 |