fckeditor javascript版...
时间:2010-08-12 来源:zwseaman
1 引入fckeditor js 文件
<script type="text/javascript" src="/fckeditor/fckeditor.js"></script>
2 添加textarea
<textarea id="fckText" name="fckText" cols="10" rows="10" style="width:100%; " >内容区域</textarea>
<input type="hidden" name="Content" id="Content" />
3 加载绑定textarea
function loadFCK(obj){ var fck = new FCKeditor("fckText"); fck.Height = 240; fck.ToolbarSet = "Basic"; fck.ReplaceTextarea(); }
4 js取值,将内容绑定到隐藏域(使用了jQuery)
if(window.FCKeditorAPI){ var oEditor = FCKeditorAPI.GetInstance("fckText"); $("#Content").val(oEditor.GetXHTML(true)); }
相关阅读 更多 +