Fckeditor编辑器出现乱码的解决方法
来源:互联网 发布:jenkins linux打包ios 编辑:程序博客网 时间:2024/06/04 18:24
我用之前介绍的那种方法(上一稿)把编辑器嵌入到网页后,发现出现了乱码,因为fckeditor的编码是utf-8,而我的网页编码是gb2312。经过上网查找资料得到了一个方法就是把编辑器的编码改下,但是还是出现同样的问题,于是我尝试用js的方法调用编辑器,最终问题解决。
具体方法如下:
在要调用编辑器的页面最上面包含文件如下所写
<script src="fckeditor/fckeditor.js"></script>
在输入框下面加入下面代码
<textarea id="summary" name="summary" cols="45" rows="5"></textarea> //这是输入框
<script>
showFCKeditor();
//显示FCKeditor编辑器,summary为文本域id
function showFCKeditor(){
var oFCKeditor = new FCKeditor('summary'); //summary为输入框的id,用来获取编辑器的值
oFCKeditor.BasePath = "/fckeditor/"; //编辑器的路径,我的在根目录
oFCKeditor.Height = "300";
oFCKeditor.Width = "100%";
oFCKeditor.ReplaceTextarea();
}
</script>
<script>
function getFCKeditorValue(textareaID){
var fckEditor = FCKeditorAPI.GetInstance(textareaID);
var fckEditorValue = fckEditor.EditorDocument.body.innerHTML;
return fckEditorValue
}
function setFCKeditorValue(str){
var fckEditor = FCKeditorAPI.GetInstance("summary");
fckEditor.EditorDocument.body.innerHTML = str;
}
</script>
- Fckeditor编辑器出现乱码的解决方法
- ECSHOP编辑器Fckeditor上传图片中文名称乱码的解决方法
- FCKeditor 2.3中文文件上传时出现乱码的解决方法
- 【解决方法】Ubuntu文本编辑器gedit打开中文出现乱码的
- fckeditor编辑器上传文件出现invalid Request问题解决!(转的)
- 关于百度编辑器的内容用ajax传回struts的action后台出现乱码的解决方法
- FCKeditor编辑器的使用
- FCKeditor编辑器的应用
- FCKeditor编辑器的小贴士
- fckeditor编辑器的使用
- FCKEDITOR编辑器的使用
- fckeditor编辑器的使用
- 在redhat linux中实用vi编辑器出现乱码解决方法
- FCKEditor漏洞的解决方法
- FCKEditor漏洞的解决方法
- FCKeditor在线编辑器解决中文乱码办法
- FCKeditor编辑器 中文乱码问题 彻底解决方案
- Fckeditor解决上传中文名称图片出现乱码
- ORACLE 10G rman 备份脚本
- FCKeditor在ASP设置环境中的使用
- 创建RMAN CATALOG
- 在ubuntu中安装五笔输入法
- 二级联动
- Fckeditor编辑器出现乱码的解决方法
- 物竞天择,适者生存
- Top 100 (sorted by "scattergory")
- joomla! virtuemart 购物车接口调用之入加入购物车
- ERROR:invalid operands to binary -
- poj1177(1)
- 就业能力
- “侵入”住宅的北京农夫世家餐饮管理有限公司青蛇
- 饭卡 hdu2546