TinyMCE:API/tinymce.Editor/onChange
From Moxiecode Documentation Wiki
Contents |
[edit]
Event: onChange
[edit]
Summary
This event gets executed when contents inside the editor gets changed for example after bold command or when the user enters some text into the editor.
[edit]
Syntax
event_callback(<tinymce.Editor> ed, <Object> l, <tinymce.UndoManager> um)
[edit]
Parameters
- ed
- Sender object/Editor instance that is serializing an element.
- l
- Undo level that got added.
- um
- Undo manager that the level was added to.
[edit]
Examples
// Adds an observer to the onChange event using tinyMCE.init
tinyMCE.init({
...
setup : function(ed) {
ed.onChange.add(function(ed, l) {
console.debug('Editor contents was modified. Contents: ' + l.content);
});
}
});
// Adds an observer to the onChange event using the render method
var ed = new tinymce.Editor('someid', {
.. Some settings
});
ed.onChange.add(function(ed, l) {
console.debug('Editor contents was modified. Contents: ' + l.content);
});
ed.render();
