Hello,
i try the code below and add this code
without this code above all works fine but when i add this code in the code below i get the editor at the first dblclick and when i reload the text via ajax and doubleclick again on the text i get the error:
"instance kikeditor already exists. How can i fix this problem?
i try the code below and add this code
CKEDITOR.replace('kikeditor',
{
skin : 'office2003'
});without this code above all works fine but when i add this code in the code below i get the editor at the first dblclick and when i reload the text via ajax and doubleclick again on the text i get the error:
"instance kikeditor already exists. How can i fix this problem?
<script id="headscript" type="text/javascript">
//<![CDATA[
// Uncomment the following code to test the "Timeout Loading Method".
// CKEDITOR.loadFullCoreTimeout = 5;
window.onload = function()
{
// Listen to the double click event.
if ( window.addEventListener )
document.body.addEventListener( 'dblclick', onDoubleClick, false );
else if ( window.attachEvent )
document.body.attachEvent( 'ondblclick', onDoubleClick );
};
function onDoubleClick( ev )
{
// Get the element which fired the event. This is not necessarily the
// element to which the event has been attached.
var element = ev.target || ev.srcElement;
// Find out the div that holds this element.
element = element.parentNode;
if ( element.nodeName.toLowerCase() == 'div'
&& ( element.className.indexOf( 'editable' ) != -1 ) )
replaceDiv( element );
CKEDITOR.replace('kikeditor',
{
skin : 'office2003'
});
}
var editor;
function replaceDiv( div )
{
if ( editor )
editor.destroy();
editor = CKEDITOR.replace( div );
}
//]]>
</script>