先放效果图:
格式如下:
后台获得:
下面是代码实现:
html:
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Default Examples</title>
<style>
form {
margin: 0;
}
textarea {
display: block;
}
</style>
<link rel="stylesheet" href="../static/css/default.css" type="text/css">
<script type="text/javascript" src="../static/js/kindeditor-all.js"></script>
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../static/js/zh_CN.js"></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
window.editor = K.create('#editor_id', {
//这里是指定的文件上传input的的属性名
filePostName: "myFileName",
//这里就是指定文件上传的请求地址,上面也已经说了,upload_json.jsp就相当去一个servlet去进行保存文件,这个地方很重要
uploadJson: 'http://localhost:8080/User/inserKingedusImg',
resizeType: 1,
allowPreviewEmoticons: true,