var editor; $(function(){ // When the user double-clicks on a "content" element, replace it with the CKEditor and surround it with a form. $('.content').dblclick( function() { if( editor ) editor.destroy(); //$(this).ckeditor().wrap( '
' ); $(this).ckeditor(function(){}).wrap( '' ); $(this).before( '' ); editor = $(this).ckeditorGet(); }); //$(editor).bind('click',function(){alert("OIOIOIOI!!");}) // $(editor).setData.ckeditor('TESTESTEST!!'); --- was using this - thought it was working.... //.updateElement(); $(editor).bind('destroy',function(){alert("OIOIOIOI!!");}) }); /* var editor; $(function() { $('.content').dblclick( function() { if( editor ) editor.destroy(); editor = CKEDITOR.replace( this ); }); }); */ /* var editor; function replaceDiv( div ) { if ( editor ) editor.destroy(); editor = CKEDITOR.replace( div ); } */