WML: An Introduction - Shuffle That Deck
(Page 3 of 6 )
WML cards are not just made up of text-only pages. Various elements can be used to build a nicely formatted card, which can be used to gather information, including anything from stock quotes to weather updates. There is support for various other tags, which we’ll see in our next example. WML also supports variables, which is great when wanting to interact with the user.
WML also has a scripting counterpart, which can be compared to Javascript for web browsers. WMLScript can be used to further enhance the interaction process with the end-user. WMLScript features numerous libraries ranging from String, Console, and Dialog functions that a developer can take advantage of in their WAP sites. The libraries are the equivalent to APIs in Java:
confirm
dialogs.confirm(message, ok, cancel)
Displays the given message and two reply alternatives: ok and cancel. Waits for the user to select one of the reply alternatives and returns true for ok and false for cancel.
Parameters
message = String
ok = String (text, empty string results in the default implementation-dependent text)
cancel = String (text, empty string results in the default implementation-dependent text)
Return Value
Boolean or invalid
Examples
function onAbort() {
return Dialogs.confirm("Are you sure?","Well...","Yes");
};
Next: Would You Like My Special Offer >>
More Web Services Articles
More By Frank Manno