初次用到這個工具,在取值這步就掉坑裏了,很多文章寫的取值是
var content = $('#summernote').summernote('code');我只能說我是半天取不了值,還以爲是取到的值格式有問題...總之用這行代碼我是沒有取到正確的值的。
正確的操作代碼如下:
取值: var comment=$(".summernote").code()
賦值: $(".summernote").code(data.comment)
置空: $(".summernote").code('')
初始化:$('.summernote').summernote({
height: 200, // set editor height
minHeight: null, // set minimum height of editor
maxHeight: null, // set maximum height of editor
focus: false // set focus to editable area after initializing summernote
})