Hi Guys,
I am trying to populate my editor with the content from db via AJAX/XML. I don't really know what to do and how to do it. Please see my code below:
HTML file:
In my javascript file(onchange event):
When I run the above, it gives me nothing. I wanted to try to get it to work before I start exporting my AJAX stuff into the editor. But here is the piece of AJAX than I intend to use once it is working:
Any help would be GREATLY appreciated.
Regards
Shaolin
I am trying to populate my editor with the content from db via AJAX/XML. I don't really know what to do and how to do it. Please see my code below:
HTML file:
<script type="text/javascript"> var oFCKeditor = new FCKeditor('FCKeditor1'); oFCKeditor.BasePath = "../fckeditor/"; oFCKeditor.Create(); </script>
In my javascript file(onchange event):
var div = document.getElementById("FCKeditor1"); var fck = new FCKeditor("FCKeditor1"); div.innerHTML = "test";
When I run the above, it gives me nothing. I wanted to try to get it to work before I start exporting my AJAX stuff into the editor. But here is the piece of AJAX than I intend to use once it is working:
xmlDoc.getElementsByTagName("description")[index-1].childNodes[0].nodeValue;
Any help would be GREATLY appreciated.
Regards
Shaolin
Re: AJAX Help
Re: AJAX Help
I'm doing the same thing. I'm an experienced fumbler of javascript, I can make things happen but I'm no expert, but my research as yet inconclusive has led me to this solution for targeting the fckeditor.
Basically the edit box is a page built dynamically inside an iframe. You have to target that and 'insert' the HTML or text. So far I have this
BUT, it adds to my existing text rather than replaces. I just discovered it so I'll need a little more work but I am sure I can get it to do what I want in my fumbling fashion.

ok, seconds later after another search on this FCKeditorAPI found this
viewtopic.php?f=6&t=9319&p=24228&hilit=FCKeditorAPI#p24228
changes insertHtml to setHtml, I'm going to try it now