Hi,
I've searched the forum and checked Google but it is difficult to define this problem in a single search term..
It seems that once .ckeditor() has been loaded it hooks onto my textarea's ID and if called again produces a javascript exception error.
Is there a way I can unload .ckeditor every time I use a .get() so that it will 'reattach' itself to the textarea?
Example Code:
index.php
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="../ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#getnumber').click(function(){
var id = $('#number').val();
$.get("load.php", { id: id },
function(data)
{
$('#content').html(data);
$('.rich').ckeditor();
}
);
});
});
</script>
</head>
<body>
<div id="input">
<input type="text" id="number" />
<button id="getnumber" type="submit">Get Number</button>
</div>
<div id="content">
</div>
</body>
</html>
load.php
<p> <textarea class="rich" id="one" rows="3" cols="80"><?php echo $_GET['id']; ?></textarea> </p>
This code only works the first time the Get Number button is clicked changing the input field and clicking Get Number thereafter generates a javascript error. The error can be avoided by using a dynamic ID on the textarea, however this isn't helpful!
If anyone knows a way of over coming this problem it would be very much appriciated.

Re: Jquery .get() and .ckeditor()
Re: Jquery .get() and .ckeditor()
Any CKEditor guru's around?
Re: Jquery .get() and .ckeditor()
A collegue of mine found the answer..
http://stackoverflow.com/questions/1794 ... ady-exists
$editors.each(function() { var editorID = $(this).attr("id"); var instance = CKEDITOR.instances[editorID]; if (instance) { CKEDITOR.remove(instance); } }Re: Jquery .get() and .ckeditor()
No, please, don't use CKEDITOR.remove specially if you plan to create/destroy several instances or the memory will never be released.
You must use instance.destroy() to get rid of an instance that you want to remove.
http://docs.cksource.com/ckeditor_api/s ... ml#destroy
Re: Jquery .get() and .ckeditor()