|
Now here is the code of the program.
|
<?xml
version="1.0"?>
<!DOCTYPE
wml PUBLIC "-//WAPFORUM//DTD WML
1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml"> |
|
<wml>
<card id="Card1" title="Learning WML">
<onevent type="ontimer">
<go href="#menu"/>
</onevent>
<timer value="30"/>
<p>
Get ready to learn WAP in record time!
</p>
<do type="accept" name="card2" label="Continue">
<go href="#menu"/>
</do>
</card>
<card id="menu" title="Learning WML">
<p>Welcome to the exciting world of WAP!</p>
</card>
</wml>
|
First of all copy the above code in the following
text box and then press test button to test it.
In the above example we have created two cards. You
can create as many as you want, but the card ids should
the unique.
Now take a closer look at <timer> element.
Timer element invokes a task after some period of user
inactivity. Syntax of time element is:
<timer name="variable"
value="value"/>
Attributes
name: Name of the variable.
value: 1/10 of seconds. 30 means 3
seconds.
<go> element opens a new URL, in this case it
opens the second card "menu".
<do> element is used as a navigational help.
With the help of do-element user can start a action on
the displayed card. Some of the uses of do-element are-
Jump to previous page:
<do type="prev"
title="Back">
<prev/>
</do>
Jump to main page:
<do type="accept"
title="Main">
<go href="index.wml"></go>
</do>
Jump to help:
<do type="help" title="Help">
<go href="#help"></go>
</do>
|