integration within a div tag that is updated with ajax:
Hello friends, I am trying to integrate CKEditor in my website, I have a problem, I update the div tag where the Texarea of CKEditor and not working, but without the tax burden necessary for the CK Editor works.
step 1 charging js:
<script src="ckeditor/ckeditor.js"></script>
Step 2 charging Script
<script type="text/javascript">
function ajaxFunction() {
var xmlHttp;
try {
xmlHttp=new XMLHttpRequest();
return xmlHttp;
} catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
return xmlHttp;
} catch (e) {
try {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttp;
} catch (e) {
alert("Tu navegador no soporta AJAX!");
return false;
}}}
}
function Enviar(_pagina,capa) {
var ajax;
ajax = ajaxFunction();
ajax.open("POST", _pagina, true);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.onreadystatechange = function() {
if (ajax.readyState==1){
document.getElementById(capa).innerHTML = " Aguarde por favor...";
}
if (ajax.readyState == 4) {
document.getElementById(capa).innerHTML=ajax.responseText;
}}
ajax.send(null);
}
</script><script type="text/javascript">
step 3 charging texare
<textarea class="ckeditor" id="ckeditor" name="ckeditor" cols="1" rows="1" required>Edite el Contenido de la Noticia en esta Zona</textarea>
step 4 script call:
<li class="item4"><a href="#">Editor<span>►</span></a>
<ul>
<li class="subitem1"><a href="javascript:Enviar('menuADM/cpanel-noticias.php','contenido');">Agregar Noticia<span>►</span></a></li>
</ul>
</li>
Architecture of chaging the Web site:
Main site: prueba .php
-- Secundary file
-------------------------------------------------------------------
<?php include("php/head.php"); ?> called the head tag content
-----Contenido:
<title>prueba</title>
<script src="ckeditor/ckeditor.js"></script>
-------------------------------------------------------------------
<?php include("php/madm.php"); ?> menu called content where ajax script starts then updates the div containing the CKEditor
-----Contenido:
<li class="item4"><a href="#">Editor<span>►</span></a>
<ul>
<li class="subitem1"><a href="javascript:Enviar('menuADM/cpanel-noticias.php','contenido');">Agregar Noticia<span>►</span></a></li>
</ul>
</li>
-------------------------------------------------------------------
tag update
<div width="100%" id="contenido"> hello </div> this div is updated with ajax content changing asynchronously:
-------------------------------------------------------------------
new content is next, a call to the PHP include () function which works well as PHP and displays data
sub menu file : 'menuADM/cpanel-noticias.php'
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td >
<?php include("../php/ckeditor.php"); ?>
</td>
</tr>
</table>
File content ckeditor.php
<textarea class="ckeditor" id="ckeditor" name="ckeditor" cols="1" rows="1" required>Edite el Contenido de la Noticia en esta Zona</textarea>
The problem is that the load applied textarea but the call to CKEditor functions and displays options for editing text. I do not know if there is a problem with the update script, which does not allow for modifying the textarea ckeditor functions. Please help with integration. Thank you very much for your attention any questions about the code feel free to come I Have This Test.
more information
IE Explorer Send this Error:
Error Details page User Agent: Mozilla/4.0 (compatible; MSIE 7.0, Windows NT 6.1, WOW64; Trident/6.0; SLCC2;. NET CLR 2.0.50727;. NET CLR 3.5.30729;. NET CLR 3.0. 30729, Media Center PC 6.0; InfoPath.3;. NET4.0C;. NET4.0E) Date: Sun, 20 Jan 2013 22:10:39 UTC Message: Could not get property 'GetEditor' null reference or without define Line: 252 Char: 105 Code: 0 URI: http://localhost/ckeditor/ckeditor.js