Full-house, Go-Fish, and Blackjack – some of my favorite games to play when I’m with friends. Alright, maybe that’s not true, but they’re definitely a way to pass the time. The words “deck” and “card” are synonymous to playing cards. However, they are also the terms used when developing WAP-enabled websites using WML. In this tutorial, I’ll give a breakdown on just what WAP and WML are and how they can be used. We’ll also run through creating a simple WAP-enabled site making use of multiple cards in a deck. There will be ample code to get you started on developing your own WAP-enabled site, whether for fun or for business.
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"); };