FCKeditor文字编辑器的js调用
1.需要fckeditor包 下载地址 http://dl.pconline.com.cn/html_2/1/776/id=48351&pn=0.html
<table>
<tr>
<th align="right">内容:</th>
<td colspan="2">
<SCRIPT type="text/javascript">
var txt = new FCKeditor("txt");
txt.BasePath = "<%=webapp%>/resource/fckeditor/";
txt.Config["CustomConfigurationsPath"]="<%=webapp%>/resource/fckeditor/myconfig.js"; txt.Config["LinkBrowser"] = false ;
txt.Config["ImageBrowser"] = false ;
txt.Config["FlashBrowser"] = false ;
txt.Config["MediaBrowser"] = false ; txt.Config["LinkBrowserURL"] = "<%=webapp%>/resource/fckeditor/editor/filemanager/browser/default/browser.html?Connector=<%=webapp%>/servlet/upload.do" ;
txt.Config["ImageBrowserURL"] = "<%=webapp%>/resource/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=<%=webapp%>/servlet/upload.do" ;
txt.Config["FlashBrowserURL"] = "<%=webapp%>/resource/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=<%=webapp%>/servlet/upload.do" ;
txt.Config["MediaBrowserURL"] = "<%=webapp%>/resource/fckeditor/editor/filemanager/browser/default/browser.html?Type=Media&Connector=<%=webapp%>/servlet/upload.do" ; txt.Config["LinkUpload"] = true ;
txt.Config["ImageUpload"] = true ;
txt.Config["FlashUpload"] = true ;
txt.Config["MediaUpload"] = true ; txt.Config["LinkUploadURL"] = "<%=webapp%>/servlet/upload.do" ;
txt.Config["ImageUploadURL"] = "<%=webapp%>/servlet/upload.do?Type=Image" ;
txt.Config["FlashUploadURL"] = "<%=webapp%>/servlet/upload.do?Type=Flash" ;
txt.Config["MediaUploadURL"] = "<%=webapp%>/servlet/upload.do?Type=Media" ; txt.ToolbarSet="My";
txt.Height=310;
txt.Value="";
txt.Create(); </SCRIPT>
</td> </tr>
</table>
2.信息保存注意
String str=request.getParameter("txt");
str=str.replaceAll("((\\r?\\n)+|\\t*)", "");