Jquery获取ckEditor的内容
在页面中我载入了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();
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。