TinyMCE:API/tinymce/addUnload
From Moxiecode Documentation Wiki
< TinyMCE:API | tinymce
Contents |
[edit]
Method: addUnload
[edit]
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.
[edit]
Syntax
<function> addUnload(<function> f, <Object> s)
[edit]
Parameters
- f
- Function to execute before the document gets unloaded.
- s
- Optional scope to execute the function in.
[edit]
Returns
Returns the specified unload handler function.
[edit]
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;
});
