在页面中我载入了ckEditor作为我程序内容的输入。

<textareaname="content"id="content"></textarea><br><inputtype="submit"value="submit"onclick="submit()"><scriptsrc="/ckeditor/ckeditor.js"></script><scripttype="text/javascript">CKEDITOR.replace('content',{filebrowserBrowseUrl:'/ckfinder/ckfinder.html?Type=Files',filebrowserImageBrowseUrl:'/ckfinder/ckfinder.html?Type=Images',filebrowserFlashBrowseUrl:'/ckfinder/ckfinder.html?Type=Flash'});</script>

但是我页面中是使用Jquery进行页面提交的,但是直接用$("#content").val()是无法拿到content内容的。这里我们需要使用ckEditor内置的函数来拿到这个内容。

varoEditor=CKEDITOR.instances.content;varcontent=oEditor.getData();