需要引用的js文件:
Content/JQuery-1.2.6.js
fckeditor/fckeditor.js
JQuery.FCKEditor.js
JavaScript代码:
$(document).ready(function(){
//初始化FCKEditor
$.fck.config = {path: '../../FCKeditor/', height: 300 ,toolbar:'Basic'};
$('textarea#infoContent').fck();
});
HTML代码:
<textarea id="infoContent" name="infoContent" rows="22" ></textarea>
读取FCKEditor的值代码:
$.fck.content('infoContent', ''); //注意‘infoContent’即为你绑定的textArea的Id或name,这样才能取得值