WMLScript » WMLBrowser » WMLBrowser.getCurrentCard

Syntax:
WMLBrowser.getCurrentCard()

Returns the URL of the current card.

The WMLBrowser.getCurrentCard function returns the smallest relative URL of the current card with respect to the base URL. If the current card does not have the same base URL as the WML deck, then an absolute URL is returned.

If there is no current card, invalid will be returned.

This function does not take a parameter.

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">
   <p>
   getCurrentCard example
   </p>
   <do type="accept">
      <go href="GetCurrentCardExample.wmls#findgetcurrentcard()" />
   </do>
</card>

<card id="card2">
<p>
   current card = $(currentcard)
</p>
</card>

</wml>
Explanation:

Code for GetCurrentCardExample.wml

Language(s): WML
Code:
extern function findgetcurrentcard()
{
   var curcard = WMLBrowser.getCurrentCard();
   WMLBrowser.setVar("currentcard", curcard);
   WMLBrowser.go("GetCurrentCardExample.wml#card2");
};
Explanation:

Code for GetCurrentCardExample.wmls

Language(s): WML

See Also: