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

Stop responding to hyperlink clicks in a document.

// How do I remove a hyperlink click listener in a document?

// Cancel a previously registered hyperlink click handler to prevent it from firing in a document.

Api.detachEvent("asc_onHyperlinkClick");