TinyMCE trouble when loading text (probably Ajax related)

0

I have a textarea, this is the code:

<textarea id="mailtemplate4" class="mceEditor" rows="20" cols="139" name="templatearea4"></textarea>

I am using the tinyMCE Editor to display some text which gets generated in an Ajax request. Problem is, the editor shows up, but the text is never displayed, this is the code which is executed once the Ajax request has finished:

// this returns an object which has the right mce editor container and so on
var myControl = tinyMCE.get('mailtemplate4');

Now I am trying to set some text using this code:

myControl.setContent("some text");

This is not working and I am getting this execption:

Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMHTMLDocument.implementation]" nsresult: "0x8000ffff ....

Why? I am loading the editor like this:

tinyMCE.init({
    mode : "specific_textareas",
    editor_selector : "mceEditor",
    theme : "simple"   
});

It seems there are no JS errors.

php
tinymce
asked on Stack Overflow Jun 18, 2012 by EOB • edited Oct 8, 2017 by Cœur

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0