WMLScript » WMLBrowser » WMLBrowser.go

Syntax:
WMLBrowser.go(url)
url
The mandatory url parameter can be a relative or absolute URL of the card you wish to navigate to. A relative URL will be resolved against the base URL of the current WML deck.

Orders the browser to load the given URL.

The WMLBrowser.go function directs the browser to load the given URL. To effect this, the WMLScript interpreter returns control to the WML browser and then the specified card is loaded. The empty string "" is returned by this function.

If the URL cannot be loaded, the browser will display the appropriate error message.

Since calls to the WMLBrowser.go and WMLBrowser.prev functions override each other, only the last call will determine the settings in effect.

In WML, the go tag performs a similar task.

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>
   go example
   <br />
   always return here
   </p>
   <do type="accept">
      <go href="GoExample.wmls#findgo()" />
   </do>
</card>

</wml>
Explanation:

Code for GoExample.wml

Language(s): WML
Code:
extern function findgo()
{
   WMLBrowser.go("#card1");
};
Explanation:

Code for GoExample.wmls

Language(s): WML

See Also: