struts2和kindeditor結合使用,無法獲取文本域的值

今天做項目,無法獲取kindeditor文本域中的值,頭疼之,最後終於找出瞭解決辦法,

參考網址:http://e-mailwu.blog.163.com/blog/static/651040362013311160913/

直接上代碼:

<script type="text/javascript">
KindEditor.ready(function(K) {
var editor1 = K.create('textarea[name="blog.details"]', {
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();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
},afterBlur: function(){this.sync();}
});
prettyPrint();
});
</script>

主要是加了以上紅色的段,問題就解決了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章