Welcome to Developer's Home Sunday, April 20, 2014
Home - DevelopersHome.com

Clearing Variables and URL History: newContext() Function


Preferences - Do not show ads

The newContext() function is used to clear all variables and the URL history stored in the WML browser. The newContext() function does not take any parameters. Its syntax is like this:


WMLBrowser.newContext();


If the function call succeeds, newContext() returns an empty string, otherwise it returns an invalid value.

Below are some WMLScript examples that can help you understand the usage of the newContext() function better. Let's say you call the following script from a WML card:


extern function example_func1()
{
  WMLBrowser.newContext();
  WMLBrowser.prev();
}


In the above script, the call to prev() will not have any effect since the URL history stack has been cleared.

Note that any calls to the prev() function before calling newContext() will also have no effect. For example:


extern function example_func2()
{
  WMLBrowser.prev();
  WMLBrowser.newContext();
}


This is because the clearing of the URL history is done before the WML browser takes back control from the WMLScript interpreter, whereas the "going backward" task is done after the WML browser takes back control from the WMLScript interpreter.


Page 32 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