FUNCTION: WMLBrowser.newContext
WMLBrowser.newContext( )
The WMLBrowser.newContext function clears out the current WML browser
context. This entails emptying the navigation stack history and clearing
out all variables. Upon completion, the empty string "" is returned.
Note that any pending navigation requests from either a WMLBrowser.go
or WMLBrowser.prev function call will not be effected.
In WML, the card
tag has a newcontext attribute that performs a similar purpose.
This function does not take a parameter.
Code for NewContextExample.wml
<?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>
newContext example
</p>
<do type="accept">
<go href="NewContextExample.wmls#findnewcontext()"
/>
</do>
</card>
<card id="card2">
<p>
Should return the empty string
<br />
new context = $(newcontext)
</p>
</card>
</wml>
Code for NewContextExample.wmls
extern function findnewcontext()
{
var newcon = WMLBrowser.newContext();
WMLBrowser.setVar("newcontext", newcon);
WMLBrowser.go("NewContextExample.wml#card2");
};
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information
|