我网站的文本编辑区打算用FCKeditor,版本FCKeditor-2.6.4,FCKeditor-2.4.1 forjava
在网上找的列子里是用标签引入的:<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<FCK:editor instanceName="content"> <jsp:attribute name="value"> 您的内容..... </jsp:attribute></FCK:editor>
如果像这样算跨域访问不?会不会被屏蔽掉?
那么普通的引入怎么写呢?不用标签的
在网上找的列子里是用标签引入的:<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<FCK:editor instanceName="content"> <jsp:attribute name="value"> 您的内容..... </jsp:attribute></FCK:editor>
如果像这样算跨域访问不?会不会被屏蔽掉?
那么普通的引入怎么写呢?不用标签的
例:
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload=function(){
var oFCKeditor = new FCKeditor('MyTextarea') ;
oFCKeditor.BasePath = "fckeditor/";
//oFCKeditor.BasePath = "/FCKEditTest/fckeditor/";
oFCKeditor.ReplaceTextarea();
}
</script>
</head>
这里的MyTextarea和oFCKeditor.BasePath = "fckeditor/"; 都分别是什么呢?
需要web.xml里配置吗?
oFCKeditor.BasePath = "fckeditor/"指的是,你的FCKEditor文件所在的根目录,其实就是/webroot/fckeditor/
用了1楼的代码,然后按4楼说的将textarea的id改成MyTextarea就OK了