views:

504

answers:

4

I am preparing a script. I am using AJAX(load()) with jQuery.

I am getting a page which includes textarea with ckeditor by load() jQuery AJAX function.

Although I include ckeditor's.js file, loaded page doesn't includes javascript file and shows a normal textarea without ckeditor.

How can I load file which includes textarea with ckeditor?

A: 

After creating the textarea with load(), you have to call CKEDITOR.replace() on any textareas which you have created, in order to initialize the editor... Are you doing this?

If you are loading multiple textareas, and you want all the textareas in the document to become CKEDITORs, then you do:

load();
CKEDITOR.replaceAll();
Stobor
AJAX(load()); is not a function. load() is a function.
sundowatch
Fair enough; I wasn't sure from your question whether you were passing the data from the `load()` function to some other method to generate the page content...
Stobor
A: 

I am using ajax load like that:

$(".main").load("new_doc.php");

new_doc.php is:

<script type="text/javascript" src="files/ckeditor.js"></script>
<textarea class="ckeditor" cols="80" id="editor" name="editor" rows="10">asddsa</textarea>

I see only normal textarea.

sundowatch
A: 

OK friends I solve this solution:

I am getting new_doc.php (loaded page) with ckeditor by using jquery load(); fn.

So the codes see the basePath as new_doc.php's directory. I used this function:

CKEDITOR.basePath = "ckeditor/";

and I copied "skins" directory which is in the "ckeditor" directory to new_doc.php's directory.

And the solution is solved.

Thanks to everybody.

sundowatch
A: 

You should look CKEDITOR wiki.