頁面上方應該有類似這樣的代碼
<script type="text/javascript">
var editor;
setTimeout(function(){
editor = CKEDITOR.replace("productDesc");
CKFinder.setupCKEditor( editor, '/ckfinder/' );
},'800');
</script>
<code>editor.document.getBody().getText(); </code><code>//取文本形式的值</code>
<code>editor.document.getBody().getHtml(); 或 editor.getData()</code><code>//取包含html代碼的值</code>
//去掉前後空格後的長度
<code>var len = $.trim(editor.document.getBody().getText()).length;</code>
本文轉自 藝晨光 51CTO部落格,原文連結:http://blog.51cto.com/ycgit/1680675,如需轉載請自行聯系原作者