WML » Tags » prev

Syntax:
<prev />

<prev>...</prev>

The prev tag is used to navigate back to the previous URL on the history stack. If there is no previous URL, processing stops and an error message may be displayed.

This is referred to as a prev task. A task is performed in response to an event. There are four tasks in WML: go, noop, prev, and refresh.
 
All URL addresses that have been visited during the current user session are stored in a history stack. As each new URL is visited, the address is added (pushed) on to the stack. Therefore, the history stack lists the URLs in order of visitation. If you navigate backwards, the top URL address is removed (popped) off of the stack.
 
The prev tag can only be nested inside the anchor and onevent tags.
 
This is a self-closing tag (unless it is used as an element to contain a setvar tag).
 
Nested Tags:  setvar

Examples

Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>

<card id="card1" ontimer="#card2">
<timer value="50" />
<p>
DevGuru
</p>
</card>

<card id="card2">
<onevent type="ontimer">
   <prev />
</onevent>
<timer value="50" />
<p>
is great!
</p>
</card>

</wml>
Explanation:

In this example, the prev tag in card2 returns the display back to card1.

Language(s): WML
Code:
...
<card id="card7">
<p>
<anchor>
   Previous Page
   <prev />
</anchor>
</p>
</card>
...
Explanation:

As demonstrated in this code fragment, you can also use the prev tag as a link in an anchor element.

Language(s): WML

See Also: