1. 下载编辑器
下载 KindEditor 最新版本,下载之后打开 examples/index.html 就可以看到演示。
下载页面:
2. 部署编辑器
解压 kindeditor-x.x.x.zip 文件,将所有文件上传到您的网站程序目录里,例如:http://您的域名/editor/
Note
您可以根据需求删除以下目录后上传到服务器。
- asp - ASP程序
- asp.net - ASP.NET程序
- php - PHP程序
- jsp - JSP程序
- examples - 演示文件删除不要的文件夹后的效果:
3. 修改HTML页面
< head runat = "server" > < title >KindEditor ASP.NET文本编辑器</ title > < link href = "themes/default/default.css" rel = "stylesheet" type = "text/css" /> < link href = "plugins/code/prettify.css" rel = "stylesheet" type = "text/css" /> < script src = "plugins/code/prettify.js" type = "text/javascript" ></ script > < script src = "kindeditor.js" type = "text/javascript" ></ script > < script src = "lang/zh_CN.js" type = "text/javascript" ></ script > < script type = "text/javascript" > KindEditor.ready(function (K) { var editor1 = K.create('#content1', { cssPath: 'plugins/code/prettify.css', uploadJson: 'asp.net/upload_json.ashx', fileManagerJson: 'asp.net/file_manager_json.ashx', 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(); }); } }); prettyPrint(); }); </ script > </ head > < body > < form id = "form1" runat = "server" > < textarea id = "content1" cols = "100" rows = "8" style = "width:700px;height:200px;visibility:hidden;" runat = "server" enableviewstate = "True" ></ textarea > </ form > </ body > |
运行后的页面效果:
转载自