Jimmypony的技术汇总区
很多都不会,很多都不懂,不要浮躁,静心学习

首先是服务端,使用前提安装好fckeditor控件 把相关的配置文件 fckeditor放到相应的目录中

1<FCKeditorV2:FCKeditor id="product_add_details" runat="server" BasePath="~/fckeditor/" Height="370px" Value="不会什么都没有吧">
2</FCKeditorV2:FCKeditor>
设置好配置路径BasePath 在.cs文件中就可以轻松的通过product_add_details.Value获取

接下来是客户端 首先在引用fckeditor.js 直接给出代码了

 

 1<script src="http://www.cnblogs.com/fckeditor/fckeditor.js" type="text/javascript"></script>
 2<script type="text/javascript">
 3var oFCKeditor = new FCKeditor( 'FCKeditor1','500px','370px');
 4oFCKeditor.BasePath    = "http://www.cnblogs.com/fckeditor/";     //设置配置文件路径
 5oFCKeditor.Value = '客户端的fckeditor' ;
 6oFCKeditor.Create() ;
 7function Button1_onclick() {
 8    var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
 9    alert( oEditor.EditorDocument.body.innerHTML ) ;
10}

11
12
</script>
13<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
还有其他内容可以参照fckeditor附带的sample\html
posted on 2008-09-03 22:39  Jim~  阅读(697)  评论(1编辑  收藏  举报