## 1、页面
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
My JSP 'kind.jsp' starting pageKindEditor.ready(function(K) {
window.editor = K.create('#editor_id');
});
内容:
2、附加kind
KindEditor.ready(function(K) {
var editor1 = K.create('textarea[name="content1"]', {
cssPath : '${path }/kindeditor/plugins/code/prettify.css',
uploadJson : '${path }/kindeditor/jsp/upload_json.jsp',
fileManagerJson : '${path }/kindeditor/jsp/file_manager_json.jsp',
allowFileManager : true,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
document.forms['example'].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
document.forms['example'].submit();
});
}
});
prettyPrint();
});
内容:
## 3、获取富文本的内容,修改前获取值
//获取kindeditor的内容
var content = $(document.getElementsByTagName("iframe")
[0].contentWindow.document.body).html()