O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Timers

In WML, you can use timers to perform timed actions. A timer measures a time period, and the browser undertakes some action when that period has expired. For example, if I assign a card's ontimer attribute to the ID of another card, the browser will navigate to that card when the timer finishes:

<?xml version="1.0"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 2.0//EN"
    "http://www.wapforum.org/dtd/wml20.dtd" >
<wml>
    <card id="Card1" ontimer="#card2" title="Timers">
					.
					.
					.
					</card>
    .
    .
    .

You create a timer with the <timer> element and give it a time period (measured in tenths of seconds) with the value attribute, like this, where I'm giving this card's timer a period of 10 seconds:

 <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required