Tutorials Point


  Learning WML
  WML References   WML Tools
  WML Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

WML ontimer Event


previous next AddThis Social Bookmark Button


The ontimer event is used to trigger an event after a given time period. Let's say you want to display a message after 5 seconds of loading a card then you can use this event to do so.

Here is the syntax to define an event handler for ontimer event:

<onevent type="ontimer">
   A task to be performed.
</onevent>
<timer value="50"/>

Here it means that a task will be performed after 5 seconds.

Following is the example showing usage of ontimer event alongwith <onevent> element.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card id="splash" title="splash">
  <onevent type="ontimer">
    <go href="#welcome"/>
  </onevent>
  <timer value="50"/>
<p>
  <a href="#welcome">Enter</a>
</p>
</card>

<card id="welcome" title="Welcome">
<p>
Welcome to the main screen.
</p>
</card>
</wml>

When you load this program it shows you following screen:

WAP Exampple19

If you do not select given Enter option then after 5 seconds you will be directed to Welcome page and following screen will be displayed automatically.

WAP Exampple20


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names