Java之品优购课程讲义_day05(6)

4.商家后台-商品录入【商品介绍】

4.1 需求分析

实现商品介绍的录入,要求使用富文本编辑器



 

4.2 富文本编辑器介绍

富文本编辑器,Rich Text Editor, 简称 RTE, 它提供类似于 Microsoft Word 的编辑功能。常用的富文本编辑器:

 

KindEditor        http://kindeditor.net/

 

UEditor        http://ueditor.baidu.com/website/ CKEditor        http://ckeditor.com/

4.3 使用 kindeditor完成商品介绍的录入

4.3.1 初始化 kindeditor 编辑器

在页面中添加 JS 代码,用于初始化 kindeditor

[AppleScript] 纯文本查看 复制代码

?

01

02

03

04

05

06

07

08

09

10

<        script        type="text/javascript">

var  editor; KindEditor.ready(function(K)  {

editor  =  K.create('textarea[name="content"]',  { allowFileManager  :  true

});

 

 

});

 

 

</script>

allowFileManager 【是否允许浏览服务器已上传文件】 默认值是:false

 

4.1.1 提取 kindeditor 编辑器的内容

在 goodsController.js 中的 add()方法中添加

[AppleScript] 纯文本查看 复制代码

?

1

$scope.entity.goodsDesc.introduction=editor.html();

4.1.1 清空 kindeditor 编辑器的内容

修改 goodsController.js 的 add 方法

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值