标签:bsp creat json new css alc href BMI height
1.editor文件夹拷进来
2. editor里jsp子文件夹里找到几个jar拷贝到网站的web-app里的lib下
3. 网页里
head里加个这个
<link rel="stylesheet" href="editor/themes/default/default.css" /> <link rel="stylesheet" href="editor/plugins/code/prettify.css" /> <script charset="utf-8" src="editor/kindeditor-all.js"></script> <script charset="utf-8" src="editor/lang/zh-CN.js"></script> <script charset="utf-8" src="editor/plugins/code/prettify.js"></script> <script> KindEditor.ready(function(K) { var editor1 = K.create(‘textarea[name="content1"]‘, { cssPath : ‘editor/plugins/code/prettify.css‘, uploadJson : ‘editor/jsp/upload_json.jsp‘, fileManagerJson : ‘editor/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(); }); </script>
body里加个显示的东西
<textarea name="content1" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;"><%=htmlspecialchars(newscontent)%></textarea>
html后面加一个
<%! private String htmlspecialchars(String str) { str = str.replaceAll("&", "&"); str = str.replaceAll("<", "<"); str = str.replaceAll(">", ">"); str = str.replaceAll("\"", """); return str; } %>
其中注意head标签里 “var editor1 = K.create(‘textarea[name="content1"]‘, {” 这个name值同你的textarea显示部分对应
标签:bsp creat json new css alc href BMI height
原文地址:https://www.cnblogs.com/pegasus827/p/8902418.html