11.2. Going to a Card in the Current Deck
To go to a card in the current deck, you just need to specify the offset in the anchor link's URL. As the target card is in the current WML document, there is no need to specify the host name, path and file name in the URL. Only the ID of the target card is needed.
The following WML example demonstrates how to go to a card in the current deck:
<?xml
version="1.0"?>
<!DOCTYPE wml PUBLIC
"-//WAPFORUM//DTD WML 1.3//EN"
"http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<card
id="tutorial_ch1" title="WML Tutorial
Ch1">
<p>
<em>Chapter 1: WML
Introduction</em><br/><br/>
...<br/><br/>
<anchor>
<go
href="#tutorial_ch2"/>
Next chapter: WML
Deck and Card
</anchor>
</p>
</card>
<card
id="tutorial_ch2" title="WML Tutorial
Ch2">
<p>
<em>Chapter 2: WML Deck
and
Card</em><br/><br/>
...<br/><br/>
<anchor>
<go
href="#tutorial_ch3"/>
Next chapter: WML
Document Structure
</anchor>
</p>
</card>
<card
id="tutorial_ch3" title="WML Tutorial
Ch3">
<p>
<em>Chapter 3: WML
Document
Structure</em><br/><br/>
...<br/><br/>
<anchor>
<go
href="#tutorial_ch4"/>
Next chapter: WML
Generic Metadata
</anchor>
</p>
</card>
<card
id="tutorial_ch4" title="WML Tutorial
Ch4">
<p>
<em>Chapter 4: WML
Generic
Metadata</em><br/><br/>
...<br/><br/>
<anchor>
<go
href="#tutorial_ch1"/>
Back to chapter 1:
WML Introduction
</anchor>
</p>
</card>
</wml>
The following screenshots show what you should see in some mobile phone emulators:
|
|
|
If you select the "Next chapter: WML Deck and Card" anchor link in the above card, the WAP browser will display the next card (card ID: tutorial_ch2) in the current deck, like this:
|
|
|
Previous Page | Page 18 of 50 | Next Page |
- 1. WML (Wireless Markup Language) Introduction
- 2. WML Deck and Card
- 3. WML Document Structure
- 4. WML Generic Metadata: <meta>
- 5. Comments in WML
- 6. Line Breaking in WML
- 7. Font Size and Style in WML
- 8. WML Preformatted Text: <pre>
- 9. WML Images
- 10. WML Tables
- 11. WML Anchor Links
- 12. Programming Softkeys of Mobile Phones and the <do> Element
- 13. WML Template and Menu
- 14. WML Events and the <onevent> Tag
- 15. Timer and the ontimer Event
- 16. WML Event: onenterbackward
- 17. WML Event: onenterforward
- 18. WML Selection Lists and the onpick Event
- 19. WML Input Fields
- 20. WML Variables
- 21. Submitting Form Data to the Server in WML
- 22. Clearing a Saved Form in WML