WMLScript
- part of WAP application layer
- based on ECMAScript
- modified to better support low bandwidth devices
- supplements the functions of WML
- can check validity of user input
- access facilites of the user agent (make phone calls, send messages, add phone number to the address book, access the SIM card)
- generate messages and dialogs locally (alerts, error messages, confirmations)
- build extensions to the user agent
Examples
<wml>
<card id="card1" title="Random Number Example">
<p align="center"> Select Random </p>
<do type ="accept" label="Random">
<go href="random.wmls#getRandom()"/>
</do>
</card>
<card id="card2" title="Random Result">
<p align="center"> Result: $(RESULT) </p>
</card>
</wml>
extern function getRandom() {
var r = Lang.random(100);
WMLBrowser.setVar("RESULT", r);
WMLBrowser.go(random.wml#card2");
}
Return to Programming the Wireless Web