Webmaster

Wap/WML : Links
Contents ]
Jean-Michel Blanchard

Linking Cards

As you know, each WML deck is made up of several cards. And as you might have guessed, these cards can be used to support the browsing function. This way, there is no need to load another document.

To create a link to a specific card in a deck, we use the id attribute of this card, prefixed by the # character. The syntax used for this is similar to the one used in HTML:

<card id="Card_1" title="Introduction">
<p>
<a href="#Card_2">Skip the introduction</a>
Your text...
</p>
</card>
<card id="Card_2" title="Main">
<p>
<a href="#Card_1">Read the introduction</a>
Your text...
</p>
</card>

The structure of this deck enables you to navigate between these two cards. At the beginning of card_1, there is a link to card 2 (Skip the introduction). And at the beginning of card_2, there is a link which takes you back to card 1 (Read the introduction).

The navigation system is even easier to implement than in HTML. Indeed, there is no need to declare destination anchors since this role has already been assumed by the card titles.

Beware of the deck size! It is tempting to use a large number of cards, but don't forget that each deck is loaded in one go and that the throughput of WAP mobile devices is limited. So make sure that your decks are not too big.



  1   2   3