开发者

replace textarea loaded via ajax with ckeditor

When I have

   ... 
    <textarea name="ta1" id="ta1" cols="50" rows="5"></textarea>
    <script type="text/javascript">
        CKEDITOR.replace( 'ta1' );
    </script>
    ...

I get a ckeditor for the textarea.

But I am in need of loading that textarea via ajax, that is I have

<textarea name="ta1" id="ta1" cols="50" rows="5"></textarea> 

in a php file which I call via ajax on "onload" of the page, and I assign the response to a div's innerHTML.

And down the line I have

<script type="text/javascr开发者_运维问答ipt">
    CKEDITOR.replace( 'ta1' );
</script>

and I just get a plain textarea, ckeditor doesn't replace it, (says that textarea is undefined), is there a work around for this?.

CKEDITOR.replaceAll()

didn't help too.

(I couldn't see the textarea loaded via ajax in view source, shows in firebug though, does that make any difference?). Any idea what could be wrong?.


Stupid me, had to call that replace(...) function right after the ajax response is complete( right after the line where response output is assigned to the div's innerhtml)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜