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.
<?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>Code for GetBaseExample.wml
extern function findgetbase()
{
var base = URL.getBase();
WMLBrowser.setVar("base", base);
WMLBrowser.go("GetBaseExample.wml#card2");
};
Code for GetBaseExample.wmls