Answer the question
In order to leave comments, you need to log in
How does tinyMCE 4 work?
There is a tinyMCE 4 editor:
$(function () {
tinyMCE.init({
selector:'#inputShortStory',
plugins: 'image link',
});
});
subject=тест&short_story=&full_story=&create=%D0%94%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C
subject=тест&short_story=%3Cp%тест%3C%2Fp%3E&full_story=%3Cp%тест%3C%2Fp%3E&create=%D0%94%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C
Answer the question
In order to leave comments, you need to log in
The thing is, when you call tinyMCE on a textarea, you don't write in that field itself, it does a bunch of wrappers over it and you end up with an iframe in front of you. So when you write something in the editor, it does not automatically save the new value in the textarea, for this it has a special trigger triggerSave (). After calling it, you will always have up-to-date content in the field. Here is the call to the editor I used:
tinymce.init({
selector: "textarea",
statusbar: false,
setup: function (editor) {
editor.on('change', function () {
tinymce.triggerSave();
});
}
});
var text = $('textarea).val();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question