
- WML Tutorial
- WML - Home
- WML - Overview
- WML - Environment
- WML - Syntax
- WML - Elements
- WML - Comments
- WML - Variables
- WML - Formatting
- WML - Fonts
- WML - Images
- WML - Tables
- WML - Links
- WML - Tasks
- WML - Inputs
- WML - Submit Data
- WML - Server Scripts
- WML - Events
- WML - Timer
- WML - Template
- WML - DTD
- WML2 - Tutorial
- WML References
- WML - Entities
- WML - Tags Reference
- WML Tools
- WAP - Emulators
- WML - Validator
- WML Useful Resources
- WML - Quick Guide
- WML - Useful Resources
- WML - Discussion
WML <timer> Tag
A timer is declared inside a WML card with the <timer> element. It must follow the <onevent> elements if they are present. (If there are no <onevent> elements, the <timer> must be the first element inside the <card>.) No more than one <timer> may be present in a card.
Attributes:
This element supports the following attributes:
Attribute | Value | Description |
---|---|---|
name | text | Sets a name for the element. |
value | number | Specifies the timer after which timer will be expired. Timeouts are specified in units of a tenth of a second. |
class | class_data | Sets a class name for the element. |
id | element ID | A unique ID for the element. |
Example:
Following is the example showing usage of <timer> 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:

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.

Advertisements