admin管理员组文章数量:1327990
Official page tinymce for event onChange
here
<script>
tinymce.init({
selector: "textarea",
language: "ru",
plugins: [
"advlist autolink lists link charmap anchor",
"searchreplace fullscreen",
"insertdatetime paste"
],
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link",
setup : function(ed) {
ed.onChange.add(function(ed, l) {
console.debug('Editor contents was modified. Contents: ' + l.content);
});
}
});
</script>
i use this code but tinymce not working and in console i see error Cannot read property 'add' of undefined
...
Tell me please why code not working nd how will be right ?
Official page tinymce for event onChange
here
<script>
tinymce.init({
selector: "textarea",
language: "ru",
plugins: [
"advlist autolink lists link charmap anchor",
"searchreplace fullscreen",
"insertdatetime paste"
],
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link",
setup : function(ed) {
ed.onChange.add(function(ed, l) {
console.debug('Editor contents was modified. Contents: ' + l.content);
});
}
});
</script>
i use this code but tinymce not working and in console i see error Cannot read property 'add' of undefined
...
Tell me please why code not working nd how will be right ?
Share Improve this question asked Aug 7, 2014 at 12:20 user2881809user28818091 Answer
Reset to default 7The function for the onChange event that you have works with TinyMCE 3.x version If you are working with TinyMCE 4.x version, the onChange function has this form:
tinymce.init({
...
setup: function(editor) {
editor.on('change', function(e) {
console.log('change event', e);
});
}
});
You can see this function in the Oficial Page here.
本文标签: javascriptTinyMceCannot read property 39add39 of undefinedStack Overflow
版权声明:本文标题:javascript - TinyMce - Cannot read property 'add' of undefined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742245246a2439099.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论