You are not logged in.
I include the Xinha javascript in the page header as required and it works, if i load the textareas with the normal content of the page.
<head>
<script type="text/javascript">
_editor_url = "xinha/" // (preferably absolute) URL (including trailing slash) where Xinha is installed
_editor_lang = "en"; // And the language we need to use in the editor.
</script>
<script type="text/javascript" src="xinha/XinhaCore.js"></script>
<script type="text/javascript" src="xinha/my_config.js"></script>
</head>
But I also need Xinha to work with textareas, which I add later dynamically to the page via an XMLHttpRequest.
Do I have to reinitialize the Xinha config after adding those textareas? And how would i do that?
Offline
See Xinha.makeEditors() and Xinha.startEditors() in the XinhaCore.js
Pretty straightforward, make your textarea, insert it into the DOM, ensure the name & id of it are the same, supply this id to makeEditors, supply the result of makeEditors to startEditors.
James Sleeman
Offline
Thanks alot, that pointed to the right direction.
Another problem was, that i used the xinha_editors object for supplying the textarea names. I noticed that it got nulled when the textareas were not found(i.e. directly after loading the page) and only reset when the page reloads, which never happens in my case.
I created a baseeditor object and copied it before the call.
xinha_editors = Object.create(xinha_baseeditors);
xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
Xinha.startEditors(xinha_editors);
Offline