views:

36

answers:

1

Hello,

I'm making a simple data grid aplication and when I click a row in a table, I want to be able to import a textarea box with CKEditor on it.

Now when I import the .php page, nothing shows up. As for every other html part, that was imported, the already running JS on the page isn't refering to the imported html. For the other code, I just rewrite the JS to the file being imported, but when I do that with ckeditor with:

<script type='text/javascript'>
        window.onload = function()
        {
            CKEDITOR.replace( 'editor' );
        };
        CKEDITOR.replace( 'editor',
        {
            filebrowserBrowseUrl : 'ckeditor/browse.php',
            filebrowserUploadUrl : 'ckeditor/upload.php'
        });
    </script>

Nothing heppens. When I import the main ckeditr.js file, it shows up at least, but the editor becomes unfocusable.

Does anyone know, what I can do about CKEditor concretely, or generally about the JS not being applyed on imported html?

A: 

Mike,

first make sure you load the ckeditor in your html head example

 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
     <script type="text/javascript" src="js/ckeditor/ckeditor.js"></script>
    </head>
    ....

then run doc ready exmample of dynamic ckeditor

$(document).ready(function(){
      $('body').append('<textarea id="editor" />');
       CKEDITOR.replace( 'editor' );
});

NOTE

this post includes jquery

mcgrailm