I'm trying to insert text into CKEditor using javascript. I have currently got this script:
function quote_<?php echo $row['pid']; ?>() {
var stringContent = $(".content_<?php echo $row['pid']; ?>").html();
$("#wysiwyg").val("[quote=<?php echo $row['author']; ?>]" + stringContent + "[/quote]");
CKEDITOR.instances.wysiwyg.insertHtml('[quote=<?php echo $row['author']; ?>]' + stringContent + '[/quote]');
}
<textarea name="message" style="width:100%" tabindex="3" rows="10" id="wysiwyg">
</textarea>
HTML is not being inserted into the instance 'wysiwyg', so I can't get this to work.
Any ideas?