跳到主要内容

detachEvent

取消订阅指定事件。

语法

expression.detachEvent(eventName);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
eventName必需string事件名称。

返回值

boolean

示例

此示例展示如何取消订阅超链接点击事件。

// How to detach from the "asc_onHyperlinkClick" event.

// Unsubscribes from the "asc_onHyperlinkClick" event.

Api.detachEvent("asc_onHyperlinkClick");