如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
<html> <script type='text/javascript' src='__PUBLIC__/js/kindeditor/kindeditor-min.js'></script> <link rel="stylesheet" href="__PUBLIC__/js/kindeditor/themes/default/default.css" /> <script charset="utf-8" src="__PUBLIC__/js/kindeditor/lang/zh_CN.js"></script> <textarea id="editor_id" name="addcontent" class="form-control" style="height:300px;">{$data.addcontent}</textarea> <!-- 第一次提交获取不到值,第二次才可以得到值 --> <script> KindEditor.ready(function(K) { window.editor = K.create('#editor_id'); }); </script> <!-- 解决方案 --> <script> var addcontent; KindEditor.ready(function(K) { addcontent = K.create('textarea[name="addcontent"]', { allowFileManager : true, afterBlur: function(){this.sync();} }); }); </script> </html>