I've built a form that calls for an editor to be loaded through AJAX, but when I insert the fetched contents I get only a <textarea>
. If I hit the toggle editor button, then the editor gets built, but it uses the default configuration for TinyMCE instead of how Joomla tries to configure it.
My Javascript:
$.ajax({
method:'GET',
url:'fetchEditor.php'
}).done(function(response) {
$('#main').append(response);
});
fetchEditor.php:
<?php
$editor = JFactory::getEditor('tinymce');
echo $editor->display('text', '', 'auto', 'auto', 55, 15, false);
?>
I tried throwing in some Javascript to re-init TinyMCE for this editor, but it also just uses the default configuration instead of what Joomla uses.