jQuery and TinyMCE

Initializing TinyMCE with JQuery

If you are trying to load TinyMCE dynamically with jQuery and just cant get tinyMCE to initialize, we’ve sorted it out.

Super simple, just no docs about this:

$('#div_id').load('page.php',function(){ 
             tinyMCE.execCommand('mceAddControl',false,'textarea_id'); 
});

Where textarea_id is replaced with the id of the tinymce textarea box.

TinyMCE Posts NULL

Here is another on that was killing me that I’ve found.

When posting a form with AJAX the TinyMCE control posts NULL.

So to fix this – add an onclick event to your submit button like this:

tinyMCE.triggerSave(true,true);