|
Newsletters
|
|
|
|
|
WMLScript Reference
WMLScript Reference
WMLScript > WMLBrowser > go()
go() - The go Function
Usage: go(url)
Description: Specifies the content denoted by the given url to be loaded. This function has the same semantics as the GO task in WML. The content is loaded only after the WML browser resumes the control back from the WMLScript interpreter after the WMLScript invocation is finished. When the WML browser loads the content, the referring URI is the URI of the current card. If a relative URI is given as the url, the WML browser must resolve it by using the URI of the current card. No content is loaded if the given url is an empty string ("").
go() and prev() library functions override each other. Both of these library functions can be called multiple times before returning the control back to the WML browser. However, only the settings of the last call stay in effect. In particular, if the last call to go() sets the URL to an empty string (""), all previous go() and prev() requests are effectively cancelled.
Invoding the Lang.abort() function along with other fatal errors cancels any pending go() request.
Example:extern function goToStart() {
var card = "http://www.host.com/loc/app.dck#start";
WMLBrowser.go(card);
};
extern function get() {
WMLBrowser.go("#next_card");
return;
};
// If the above function is invoked from the following
// WML fragment:
// ..
// <card id="referring_card" >
// ..
// <go href="myscript#get()"/>
// ..
// </card>
// ..
//
// The referring URI will be the URI of the WML card that
// invoked the function go and fulfils the script's request
// (i.e., the card with the id "referring_card").
Bookmark this page
|
|