Welcome to Developer's Home Wednesday, April 23, 2014
Home - DevelopersHome.com

WMLScript WMLBrowser Standard Library


Preferences - Do not show ads

WMLScript's WMLBrowser standard library contains seven functions in total. They are used to control the WML browser or to get information from it.


Going Forwards / Backwards to WML Cards: go() and prev() Functions

The go() function and the prev() function of the WMLBrowser standard library are used to go forwards and backwards to WML cards respectively. The syntax of go() is as follows:


WMLBrowser.go(url);


url is the URL of the WML card to go to. For example:


WMLBrowser.go("wmlscript_tutorial.wml");


The prev() function does not take any parameters. Its syntax is like this:


WMLBrowser.prev();


Both go() and prev() return an empty string if everything works fine. They return an invalid value if errors occur.

Note that the WML browser will load the target card only when it takes back control from the WMLScript interpreter.

Suppose a script calls go() or prev() multiple times before the WML browser takes back control. When the WML browser resumes control, it will only load the card specified by the last call. For example, let's say you call the following script from a WML card:


extern function example_func1()
{
  WMLBrowser.go("wml_tutorial.wml");
  WMLBrowser.go("wmlscript_tutorial.wml");
}


When the WML browser receives control, it will load the WML document wmlscript_tutorial.wml specified in the last statement.

Here is another example:


extern function example_func2()
{
  WMLBrowser.go("wml_tutorial.wml");
  WMLBrowser.go("wmlscript_tutorial.wml");
  WMLBrowser.prev();
}


When the WML browser receives control, it will go to the previous card.

If the script to be called is like this:


extern function example_func3()
{
  WMLBrowser.prev();
  WMLBrowser.prev();
}


The WML browser will go backward once, but not twice, when it takes back control from the WMLScript interpreter.


Page 31 of 71 Previous Page | Next Page
Contents at a Glance
Print this Web Page | | Back to Top
Custom Search

Feedback Form (Expand)

What do you think about this web page?






WMLScript Tutorial Table of Contents WMLScript Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page