I am loading a section of a page with an ajax call but the editor in that section is not visible when it is loaded via ajax. If I access "mysite.com/index.php?mod=page3" directly, without any ajax calls, the editor shows fine.
I will try to simplify as best I can the workings of the CMS (it is the Flatnux CMS). Here are the details of the situation:
The "pages" of my CMS correspond to the central section of the page, which is loaded according to the querystring (?mod=pagex). I have a folder for these pages: "/sections/page1.php", "/sections/page2.php", etc.
In "/sections/page3.php" I have an editor instance:
If I make an ajax call to "/sections/page3.php" and load the results into a div in the center of the page on index.php, everything shows fine except the ckeditor. All the javascript is executed fine. If I inspect the elements with the Chrome inspector I see that "<div id='emailbody'>" has received "visibility:none", but there is no ckeditor.
If instead I load the page from the querystring (index.php?mod=page3), and page3.php is php-included within that same div, then the ckeditor loads just fine.
Could it be because document.ready doesn't work the same way in an ajax call? The rest of the javascript code in document.ready works just fine... Any ideas what could be going on?
I will try to simplify as best I can the workings of the CMS (it is the Flatnux CMS). Here are the details of the situation:
The "pages" of my CMS correspond to the central section of the page, which is loaded according to the querystring (?mod=pagex). I have a folder for these pages: "/sections/page1.php", "/sections/page2.php", etc.
In "/sections/page3.php" I have an editor instance:
<!-- jquery is already loaded by the CMS theme from the Google repository... -->
<script type='text/javascript' src='/include/extra/fck3/ckeditor/ckeditor.js'></script>
<script type='text/javascript' src='/include/extra/fck3/ckeditor/adapters/jquery.js'></script>
<script type="text/javascript">
$(document).ready(function(){
floptwidth = $("#floptdiv").width()-20;
$("#emailbody").ckeditor({width:floptwidth});
});
</script>
<?php
echo "<div id='emailbody'></div>";
?>If I make an ajax call to "/sections/page3.php" and load the results into a div in the center of the page on index.php, everything shows fine except the ckeditor. All the javascript is executed fine. If I inspect the elements with the Chrome inspector I see that "<div id='emailbody'>" has received "visibility:none", but there is no ckeditor.
If instead I load the page from the querystring (index.php?mod=page3), and page3.php is php-included within that same div, then the ckeditor loads just fine.
Could it be because document.ready doesn't work the same way in an ajax call? The rest of the javascript code in document.ready works just fine... Any ideas what could be going on?

Re: editor not visible on pages loaded via ajax
Re: editor not visible on pages loaded via ajax
Re: editor not visible on pages loaded via ajax
http://docs.cksource.com/CKEditor_3.x/D ... ditor_Path
Re: editor not visible on pages loaded via ajax