I'm working with tinymce , a Javascript library to convert elements <textarea>
into web editors. This library requires jQuery to work. The jQuery version available in the project at the moment is 1.5, which for compatibility and legacy reasons I can't update. To set an option in tinymce to allow elements <textarea
> to be updated with the information entered before sending it via a <form>
prompt add this code:
tinymce.init({
selector: "textarea",
statusbar: false,
setup: function (editor) {
editor.on('change', function () {
tinymce.triggerSave();
});
}
});
The problem is with the setup variable, when associating it with the anonymous function I get an error because the method .on()
is not available in my version of jQuery. How can I convert that function to suit the version of jQuery I have? I already tried with .live()
, .delegate()
and .bind()
and I don't get the expected functionality.
Did you try using the function name directly?
change
If that doesn't work use the
onChange
tinymce.Editor.onChange
In the example define