fckeditor 客户端和服务端取值

首先是服务端,使用前提安装好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 ExpandedBlockStart.gifContractedBlock.gif < script  type ="text/javascript" >
 3var oFCKeditor = new FCKeditor( 'FCKeditor1','500px','370px');
 4oFCKeditor.BasePath    = "http://www.cnblogs.com/fckeditor/";     //设置配置文件路径
 5oFCKeditor.Value = '客户端的fckeditor' ;
 6oFCKeditor.Create() ;
 7ExpandedSubBlockStart.gifContractedSubBlock.giffunction 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

转载于:https://www.cnblogs.com/jimmypony/archive/2008/09/03/1283427.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值