Skip to main content

detachEvent

Unsubscribes from the specified event.

Syntax

expression.detachEvent(eventName);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
eventNameRequiredstringThe event name.

Returns

boolean

Example

Unsubscribe from the hyperlink click event in a document.

// How to detach from the "asc_onHyperlinkClick" event in a document.

// Unsubscribes from the "asc_onHyperlinkClick" event in a document.

Api.detachEvent("asc_onHyperlinkClick");