`
zjx2388
  • 浏览: 1304863 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

FCKEditor Demo

    博客分类:
  • J2EE
阅读更多

FCKEditor 的官方下载:

http://sourceforge.net/projects/fckeditor/

 

2.6版本的一个简单示例,下载地址:http://download.csdn.net/source/2800336(PS:不是我不想在JAVAEYE直接上传,但上传两次都没成功,故改CSDN)

 

主要开发步骤:

1.下载官方包

2.导入对于开发语言需要的一些文件

3.页面引用,如

    <!-- FCKEditor -->
	<link href="<%=basePath %>fckeditor/_samples/sample.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="<%=basePath %>fckeditor/fckeditor.js"></script>
	<script type="text/javascript">
	window.onload = function(){
	//var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ;
	var sBasePath = "<%=basePath %>fckeditor/";
	//alert(sBasePath);
	var oFCKeditor = new FCKeditor( 'contents' ) ;
	oFCKeditor.BasePath	= sBasePath ;
	oFCKeditor.ReplaceTextarea() ;
}

	</script>
	<!-- end of FCKEditor -->

 :

 4:修改原来的textarea代码:

<textarea name="contents" rows="10" cols="80" style="width: 100%; height: 200px">input something here ...</textarea>

 

需要注意的就是,textarea的名字和JS中构造的FCKeditor的名字相同

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics