alert

alert(mess, options)

使用范围: client

编程语言: javascript

父类: AbstractItem

描述说明

使用 alert 方法,创建一个显示在应用程序右上角的消息弹出框,用鼠标在页面上任意地方单击后,它会消失。

The mess parameter specifies the text that will be displayed. 使用 mess 参数指定将要显示的文本。

The options parameter is an object with the following attributes: options 参数是一个带有下列属性的对象:

  • type - 指示消息的类型 —— 字体、背景颜色和标题文本,如果未指定 header 参数。 必须是以下之一:

    • 'info',

    • 'error',

    • 'success'

    默认值是 'info'

  • header - 指定消息弹出框的标题

  • pulsate - 如果为 true ,标题将会闪动,默认为 true

  • show_header - 如果为 false, 将不显示标题

alert_erroralert_successalert 相同,它们自身就有相应的 type 类型。

示例

item.alert_error('Failed to send the mail: ' + err);
item.alert('Successfully sent the mail');