TinyMCE:API/tinymce/addUnload

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Method: addUnload

Summary

Adds an unload handler to the document. This handler will be executed when the document gets unloaded. This method is useful for dealing with browser memory leaks where it might be vital to remove DOM references etc.

Syntax

<function> addUnload(<function> f, <Object> s)

Parameters

f
Function to execute before the document gets unloaded.
s
Optional scope to execute the function in.

Returns

Returns the specified unload handler function.

Examples

// Fixes a leak with a DOM element that was palces in the someObject
tinymce.addUnload(function() {
   // Null DOM element to reduce IE memory leak
   someObject.someElement = null;
});
Personal tools