WAP之家:为您提供最全最新的WAP技术,CP.SP.3G等行业资讯。 WAP之家交流论坛全新开放 点击进入>>
WAP资讯 | 3G动态 | SP动态 | 运营商动态 | 内容商动态 | 制造商动态 | 论坛讨论>> 每次自动访问
WAP技术 | WAP源码 | 手机编程 | 手机源码 | 无线技术 | J2ME技术 | 手机软件 添加到收藏夹
IVR技术 | SP资料 | SMS MMS技术 | 商业方案 | IVR下载 | 书籍教程 | 工具软件 语言:繁體中文

WAP之家技术文章WAP教程WML教程WMLScript Dialogs Library

WMLScript Dialogs Library
作者:佚名  来源:本站整理  发布时间:2008-3-11 22:56:00

The Dialogs library contains functions that displays alert messages.


WMLScript Dialogs Library Functions

Function Description
alert() Displays a message and waits for a confirmation
 

The alert() function displays a message, waits for a confirmation, and then returns an empty string.

Syntax

n = Dialogs.alert(message)

Part Description
n The empty string returned from the function
message A string containing the message

Example

var a = Dialogs.alert("The value must be numeric!");

Result

a = ""
confirm() Displays a message and waits for an answer
 

The confirm() function displays a message, waits for an answer, and then returns a boolean value depending on which answer the user selected. If the user selected the ok value the return value is true, and if the user selected the cancel value the return value is false.

Syntax

n = Dialogs.confirm(message, ok, cancel)

Part Description
n The Boolean value returned from the function
message A string containing the message
ok A string containing the OK text
cancel A string containing the CANCEL text

Example

var a = Dialogs.confirm("Exit?","Yes","No");

Result

a = true (if "Yes" is selected)
a = false (if "No" is selected)
prompt() Displays a question and waits for an input
 

The prompt() function displays a message and waits for an input. The second parameter is a default input, that will be returned if the user does not enter a value. This function returns the user input or the default value.

Syntax

n = Dialogs.prompt(message, defaultinput)

Part Description
n The string returned from the function
message A string containing the message (question)
defaultinput A string containing the default input (answer)

Example

var a = Dialogs.prompt("Enter a number:","3");

Result

a = "5" (if the user entered the value 5)
a = "3" (if the user did not enter a value)

 

[] [返回上一页] [打 印]
文章评论

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 0分

内 容:

         (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码