Javascript 从summernote图像上载触发jquery文件上载
我试图在从summernote中选择一个图像后触发jquery文件上传方法,以便使用URL而不是base64编码 这是我目前的电话:Javascript 从summernote图像上载触发jquery文件上载,javascript,jquery,jquery-file-upload,Javascript,Jquery,Jquery File Upload,我试图在从summernote中选择一个图像后触发jquery文件上传方法,以便使用URL而不是base64编码 这是我目前的电话: $('#summernote').summernote({ toolbar: [ ['edit',['undo','redo']], ['style', ['bold', 'italic', 'underline', 'strikethrough',
$('#summernote').summernote({
toolbar: [
['edit',['undo','redo']],
['style', ['bold', 'italic', 'underline', 'strikethrough',
['insert', ['link','picture']],
['view', ['fullscreen']]
],
onImageUpload: function(files, editor, welEditable) {
uploadFile(files, editor, welEditable);
}
});
我可以调用我的uploadFile函数并传递参数,但我不清楚如何将它们传递到我的jquery文件上传调用…我知道文件上传绑定到输入按钮,因此是否有任何方法可以绕过此操作并按语法触发上传
function uploadFile(files, editor, welEditable) {
/*
$('#file_upload').fileupload('add', {
fileInput: files
});
*/
$('#file_upload').fileupload({
url: 'photos/index.php',
done: function (e, data) {
$.each(data.result, function (index, file) {
editor.insertImage(welEditable, url);
});
}
});
}