我正在尝试显示旋转,同时使用summernote上传照片,但summernote向我抛出错误:未捕获的TypeError:无法读取null的属性“书签”。照片保存在我的电脑里,但summernote没有显示。
这是mi代码:
var awaitingPopUp = '<div class="text-right"><img src="${pageContext.request.contextPath}/resources/img/spinner.gif" width="50px"/></><br /><br />';
var edit = function() {
$('.text').summernote({focus: true,height: 1000,
onImageUpload: function(files, editor, welEditable) {
sendFile(files[0], editor, welEditable);
}
});
};
function sendFile(file, editor, welEditable) {
var processDialog=bootbox.dialog({ message: awaitingPopUp, title: 'Subiendo y guardando las fotos...' });
var data = new FormData();
data.append("file", file);
$.ajax({
data: data,
type: "POST",
url: "${pageContext.request.contextPath}/addImageBlog.html/8",
cache: false,
contentType: false,
processData: false,
success: function(url) {
processDialog.modal('hide');
alert(url);
editor.insertImage(welEditable, url);
},
error: function(data){
alert("failure"+data);
}
});
}