kindeditor是在線編輯器,比較好用,以下是提供的使用這個插件的步驟。
專注于為中小企業(yè)提供成都網(wǎng)站建設(shè)、網(wǎng)站制作服務(wù),電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)明溪免費做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了近千家企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實現(xiàn)規(guī)模擴充和轉(zhuǎn)變。
asp,asp.net,php對于jsp開發(fā)沒有用,可以刪除
在WebRoot目錄下新建一個文件夾
這個文件夾是將來上傳圖片時用的,這是kindeditor默認的,當然也可以改,建議先按照這個文檔入了門后,再行修改。
和attached一樣,在WebRoot目錄下新建目錄kindeditor目錄,把上面解壓后的文件拷貝到這個目錄下。
需要把jsp目錄下的lib目錄下的jar包拷貝到WEB-INF/lib目錄下
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() +"://"
+ request.getServerName() +":" + request.getServerPort()
+ path +"/";
%>
"pragma" content="no-cache">
"cache-control" content="no-cache">
"expires" content="0">
"keywords" content="keyword1,keyword2,keyword3">
"description" content="This is my page">
"stylesheet" href="kindeditor/themes/default/default.css" />
"stylesheet" href="kindeditor/plugins/code/prettify.css" />
KindEditor.ready(function(K) {
var editor1 = K.create('textarea[name="article.content1"]', {
cssPath :'kindeditor/plugins/code/prettify.css',
uploadJson :'kindeditor/jsp/upload_json.jsp',
fileManagerJson :'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();
});
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() +"://"
+ request.getServerName() +":" + request.getServerPort()
+ path +"/";
%>
"pragma" content="no-cache">
"cache-control" content="no-cache">
"expires" content="0">
"keywords" content="keyword1,keyword2,keyword3">
"description" content="This is my page">
"stylesheet" href="kindeditor/themes/default/default.css" />
"stylesheet" href="kindeditor/plugins/code/prettify.css" />
KindEditor.ready(function(K) {
var editor1 = K.create('textarea[name="article.content1"]', {
cssPath :'kindeditor/plugins/code/prettify.css',
uploadJson :'kindeditor/jsp/upload_json.jsp',
fileManagerJson :'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();
});
以上是簡單的入門測試。