Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I initialize TinyMCE on a ajax loaded textarea in 4.x?

Tags:

I am upgrading to tinyMCE 4.x and I am attempting to initialize tinyMCE on a textarea loaded via AJAX. In 3.x I did something of the sort: TinyMCE - attach to divs loaded via AJAX calls but this does not seem to work in 4.x.

like image 600
Mike Dotterer Avatar asked Oct 24 '13 14:10

Mike Dotterer


People also ask

How do I know if my TinyMCE is initialized?

You can use tinymce. editors. length to see if there is already an editor instance initalized ( tinymce.

How do I put content in TinyMCE?

How to setContent with multiple editors. Running the setContent() function on specifically editorOne with the tinymce. get('editorOne'). setContent(contentOne); method, you can change just editorOne.


1 Answers

tinymce.remove();
tinymce.init();

This works well!

like image 157
Arquimedes de Siracusa Avatar answered Oct 14 '22 13:10

Arquimedes de Siracusa