addUnload

public function addUnload(f:function, s:Object):function
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.

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;
});

Params

Name Type Description
f function Function to execute before the document gets unloaded.
s Object Optional scope to execute the function in.

Returns

function Returns the specified unload handler function.