I have a textarea with an id of 'text'. tinyMce control is successfully added to the div containing the textarea. Using the following javascript after the textarea has written been out in PHP: "tinyMCE.get('text').setContent('blah');return false;"
I still get a blank textarea.
On first load of the page, I get the editor menu bar over the textarea as expected. There's a javascript onclick action on a button that calls (it does so) a PHP script via AJAX and that's where the textarea content should be loaded. The inner HTML produced inside a DIV when the button is clicked is:
{"innerHTML":"<textarea class=\"formElements\" name=\"text\" id=\"text\" cols=\"50\" rows=\"10\" >Blah and more blah<\/textarea>\n<script type=\"text\/javascript\">\n<!--\ntinyMCE.get('text').setContent('blah');return false;\n\/\/-->\n<\/script>\n"}
The attempt to use tinyMCE.get() is a test because the 'Blah and more blah' (pulled from a database) is not being set in the textarea HTML. In the DOM, after clicking the button, tinymce's domLoaded is true.
There are no errors or warning in Firebug.
Any ideas?