WMLScript » URL » URL.getBase

Syntax:
URL.getBase()

Returns an absolute URL.

The URL.getBase function returns the absolute URL of the current WMLScript file. The returned URL will not include the fragment portion.

The syntax of a URL is:

scheme://host:port/path;parameters$query#fragment

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

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

</wml>
Explanation:

Code for GetBaseExample.wml

Language(s): WML
Code:
extern function findgetbase()
{
   var base = URL.getBase();
   WMLBrowser.setVar("base", base);
   WMLBrowser.go("GetBaseExample.wml#card2");
};
Explanation:

Code for GetBaseExample.wmls

Language(s): WML

See Also: