The WMLBrowser library contains functions that can be used to access browser variables.
WML Browser库(Library)包含了用来访问浏览器变量的函数
WMLScript WMLBrowser Library Functions
WMLScript WMLBrowser库(Library)函数
Function 函数 | Description 描述 |
getCurrentCard() | Returns the (relative) URL of the current card 返回当前card的(相对:relative)URL |
getVar() | Returns the value of a variable 返回一个变量的值 |
go() | Goes to a new card 直接指向一个新的card |
newContext() | Clears all variables 清除所有变量 |
prev() | Goes to the previous card 直接指向前一个card |
refresh() | Refreshes the current card 刷新当前card |
setvar() | Sets the value of a variable 设置一个变量值 |
Note: The WML specification states that calls to library functions that are not supported by the browser should return invalid. Because of this, all the above functions should be tested against their return value, and proper action should be taken in case a function returns invalid.
注意:WML的规范是:如果请求的库函数(Library Function)不能被浏览器支持,那将返回“无效”(invalid);由于这点原因,上述的函数必须通过它们的返回值进行测试;而当函数返回“无效(invalid)”时也能够做出适当的反应。