您的位置:首页 > 编程语言 > ASP

在ASP中 使用 kindeditor-4.1.4编辑器的详细教程

2015-01-15 13:27 253 查看
1、去官网下载最新版本:kindeditor-4.1.4编辑器 

下载地址:http://kindeditor.net/down.php

2、将下载的包放在网站根目录下面

4、配置文件图片上传目录,如果目录在UploadFile下



3、配置调用,官方已给出调用文档 asp/deom.asp里面



4、在自己的项目中使用:

<!-- 配置编辑器 -->
<link rel="stylesheet" href="../kindeditor-4.1.10/themes/default/default.css" />
<link rel="stylesheet" href="../kindeditor-4.1.10/plugins/code/prettify.css" />
<script charset="utf-8" src="../kindeditor-4.1.10/kindeditor.js"></script>
<script charset="utf-8" src="../kindeditor-4.1.10/lang/zh_CN.js"></script>
<script charset="utf-8" src="../kindeditor-4.1.10/plugins/code/prettify.js"></script>
<script>
KindEditor.ready(function(K) {
var editor1 = K.create('textarea[name="Content"]', {
cssPath : '../kindeditor-4.1.10/plugins/code/prettify.css',
uploadJson : '../kindeditor-4.1.10/asp/upload_json.asp',
fileManagerJson : '../kindeditor-4.1.10/asp/file_manager_json.asp',
allowFileManager : true,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
},afterBlur:function(){
this.sync();
}
});

var editor2 = K.create('textarea[name="Contentb"]', {
cssPath : '../kindeditor-4.1.10/plugins/code/prettify.css',
uploadJson : '../kindeditor-4.1.10/asp/upload_json.asp',
fileManagerJson : '../kindeditor-4.1.10/asp/file_manager_json.asp',
allowFileManager : true,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
},afterBlur:function(){
this.sync();
}
});

var editor3 = K.create('textarea[name="Contentc"]', {
cssPath : '../kindeditor-4.1.10/plugins/code/prettify.css',
uploadJson : '../kindeditor-4.1.10/asp/upload_json.asp',
fileManagerJson : '../kindeditor-4.1.10/asp/file_manager_json.asp',
allowFileManager : true,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
},afterBlur:function(){
this.sync();
}
});

prettyPrint();
});
</script>


//后台ASP文档

<!-- 编辑器字符过滤 -->

<%

Function htmlspecialchars(str)
str = Replace(str, "&", "&")
str = Replace(str, "<", "<")
str = Replace(str, ">", ">")
str = Replace(str, """", """)
htmlspecialchars = str

End Function

%>

<textarea name="Content" style="width:700px;height:400px;visibility:hidden;"><%=htmlspecialchars(htmlData)%></textarea>
<textarea name="Contentb" style="width:700px;height:400px;visibility:hidden;"><%=htmlspecialchars(htmlData)%></textarea>

<textarea name="Contentc" style="width:700px;height:400px;visibility:hidden;"><%=htmlspecialchars(htmlData)%></textarea>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: