As the name says, I looked at the official documentation, but it does not work; here is my JavaScript code (using jQuery):
$(document).ready(function() { tinymce.init({ element_format: "html", schema: "html4", menubar: false, plugins: 'preview textcolor link code', selector: 'TEXTAREA#rtf', toolbar: 'preview | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | blockquote subscript superscript | code' }); tinymce.activeEditor.setContent($('TEXTAREA#rtf').text()); });
- I tried to check tinymce and tinyMCE (got this from Googling) and both of them are objects in order.
- I also tried to check tinymce.activeEditor and tinyMCE.activeEditor, but they turn out to be null !
(Cough) Somehow, after I restored everything to the place where I started, it works:
$(document).ready(function() { tinymce.init({ element_format: "html", menubar: false, plugins: 'preview textcolor link code', schema: "html4", selector: 'TEXTAREA#rtf', toolbar: 'preview | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | blockquote subscript superscript | code' }); });
I suspect this came either from the UA cache or from the XSLT result cache, which made the problem; Thanks again for your time!
javascript jquery tinymce-4
้ซ็งๆ ้ปๆ
source share