在html或jsp中使用js调用fckeditor。本地直接打开可以显示,但是通过服务器打就不能显示:本地路径打:E:\WorkSpace\filemanager-editor-proj\WebRoot\jsp\replacebyclass.html显示用服务器路径:http://localhost:8080/test/jsp/replacebyclass.html不管是jsp或是html,都是这样。不管是gbk编码还是utf-8编码也都是这样。郁闷到极点了。官方为什么可以。给出html代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample - CKEditor</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
</head>
<body>
    <form action="sample_posteddata.php" method="post">
        <p>
            <textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10;">test</textarea>
        </p>
        <p>
            <input type="submit" value="Submit"/>
        </p>
    </form>
</body>
</html>jsp文件中,加了
<%@page contentType="text/html;charset=GBK" pageEncoding="GBK"%>并把编码改成
<meta content="text/html;charset=gb2312" http-equiv="content-type"/>我十分确定jsp改为utf-8也不行。而且项目就是gbk的。对于这个未知现象我只能说我无语了。ps:fckeditor和ckeditor都是这个该死的问题~~~~~
    弄得现在我的心情就像暴风雪一样狂暴~~郁闷啊啊啊啊啊啊啊啊啊 啊啊

解决方案 »

  1.   

    确定下路径是否正确
    jsp的话最好用<script type="text/javascript" src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"> </script> 
    这样方式的方式。。
      

  2.   

    浏览器的兼容问题是很郁闷
    帮你顶顶
    src="../ckeditor/ckeditor.js"
    最好用 src=" <%=request.getContextPath()%>/ckeditor/ckeditor.js"
      

  3.   

    fkceditor在ie8是不行的,别的没试
      

  4.   

    虽然结贴了,但是问题还是老大解决的。
    我还是友善一下告诉答案吧:
    因为我们的项目用的是gbk编码,加载了spring过滤器,导致编码问题。
    所以把过滤器的路径设为只过滤action,不过滤jsp就好了。就是酱紫