q is nullUncaught TypeError: Cannot call method 'setHtml' of nullTypeError: Cannot convert 'q' to object
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <div class="editable"> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus. </p> </div> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#contentFrame").load(function(event) {
$("#contentFrame").contents().find('.editable').click(function(event){
event.preventDefault();
pageEditor = CKEDITOR.replace( this );
});
});
});
</script>
</head>
<body>
Main page.<br/>
<iframe id="contentFrame" src="divreplace.html" marginheight="0" marginwidth="0" frameborder="0" style="width: 100%; height: 200px">
</body>
</html>
Re: CKeditor in iframe, from parent = "TypeError"
You have to include the CKEditor js in the inner page if you want to edit it.
Re: CKeditor in iframe, from parent = "TypeError"