As shown in the preceding example, some actions have a direct effect on the UP.Browser and do not require the WML file that called the external WMLScript function to do anything more. When a WMLScript function returns a variable value to any WML file, the WML must retrieve the new value from the UP.Browser.
This code snippet from the preceding example returns the variable "image" with a value of "newimage.bmp" to the WML that made the initial function call.
if (action == "reset") {
//set the value of the variable "image" to a BMP file
WMLBrowser.setVar("image", "newimage.bmp");
}
In response, the WML file must include a line like the one below to retrieve the returned value:
<p align="center"><img alt="New Image" src="$(image)"/></p>
The relevant part of this example is the WML img element and in particular: src="$(image)"/
This element tells the UP.Browser to retrieve the image source file from the variable image.