如何在一个页面上添加多个KindEditor富文本编辑器

如何在一个页面上添加多个KindEditor富文本编辑器,第1张

<script type="text/javascript">

var options = {

filterMode : true,

allowImageUpload : false,

allowFlashUpload : false,

allowMediaUpload : false,

allowFileManager : false,

items : ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',

'removeformat', '卖则|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',

'insertunorderedlist', '|', 'emoticons', 'image', 'flash', 'media','|', 'link','unlink','fullscreen'],

width : '600px',

height: '250px'

}

var editor = new Array()

KindEditor.ready(function(K) {

editor[0] = K.create("#awards",options)

editor[1] = K.create("#description",options)

// 往下可以添加更多kindeditor...

})

</script>

注:代码中的#awards和#description是中陆棚要添加kindeditor的页悉困面元素id

第一步: 需要把kindeditor全部加入到项目中; 第二步: 在新添加的页面..................中孝卜加入以下代码 第三步:也是比较重要余液的一步,在web.config需要配置一些参数。 .......节点中配置 第四步:竖慎物需要注意的细节 1.在增加的时候获取字符串

第一步: 需要把kindeditor全部加入到项目中;

第二步: 在新添加的页面<head>租脊..................</head>中加入以下代码

<%-- 引用jquery--%>

<script src="JS/jquery.js" type="text/javascript"></script>

<%-- 引用kindeditor--%>

<script src="kindeditor/kindeditor.js" type="text/javascript"></script>

<link rel="stylesheet" href="kindeditor/themes/default/default.css" />

<link rel="stylesheet" href="kindeditor/plugins/code/prettify.css" />

<script type="text/javascript" charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>

<script type="text/javascript" charset="utf-8" src="kindeditor/plugins/code/prettify.js"></script>

第三步:也是比较重要的一步,在web.config需要配置一些参数。弊闷渗

<appSettings>.......</appSettings>节点中配置罩枣

第四步:需要注意的细节

1.在增加的时候获取字符串需要进行 Server.HtmlEncode(string)处理。

2.在编辑查看的时候获取字符串需要进行 Server.HtmlDecode(string)处理。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/12164881.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-21
下一篇 2023-05-21

发表评论

登录后才能评论

评论列表(0条)

保存