I've included the CKEditor on my site. Everything works even though I get this JS error:
uncaught exception: [CKEDITOR.editor] The instance "simple_editor" already exists.
The code below is contained inside a PHP file which I include where ever I want the editor. I only have one instance of the editor per page.
<textarea class='ckeditor' id='simple_editor' name='simple_editor'>".$page_content."</textarea>";
<script type="text/javascript">
CKEDITOR.replace( 'simple_editor',
{
height: '110px',
toolbar :
[
['Link','Unlink'],
['Styles','Format','Font','FontSize'],
['Bold','Italic','Underline','Strike'],
['TextColor','BGColor'],
['NumberedList','BulletedList','Outdent','Indent']
]
});
</script>
After some googling I've seen people posting some solution which dosnt work.
if (CKEDITOR.instances['simple_editor']) { delete CKEDITOR.instances['simple_editor'] };
if (CKEDITOR.instances['simple_editor']) { CKEDITOR.instances['simple_editor'].destroy(); }
Anyone know what to do? :S
remove class='ckeditor' as it's triggering the automatic replacement system.
<textarea id="textarea1" name="textarea1" runat="server" ></textarea>
<script>
$(document).ready(function () {
loadEditor('<%= textarea1.ClientID %>');
});
function loadEditor(id) {
var instance = CKEDITOR.instances[id];
if (instance) {
CKEDITOR.remove(instance);
}
CKEDITOR.replace(id, { toolbar: 'Basic' });
}
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With