初次用到这个工具,在取值这步就掉坑里了,很多文章写的取值是
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
})