https://summernote.org/deep-d.
$("-sharpsummernote").summernote("insertImage", url, function ($image) {
$image.css("width", $image.width() / 3);
$image.attr("data-filename", "retriever");
});
his official API does so.
it"s just a weird problem
onImageUpload: function(files) {
sendFile(files[0]);
},
$content is my editor ~
$content.summernote("insertImage", "/images/download.gif", function ($image) {
console.log("preview: " + fileData);
$.ajax({
dataType: "json",
type: "POST",
url: "someurl",
data: data,
cache: false,
contentType: false,
processData: false,
enctype: "multipart/form-data",
// timeout: timeoutVal,
success: function(data){
$image.attr("src", data.url);
}
});
});
this is how I use his insertImage API
as he wrote above
I can successfully use attr to replace the uploaded address of the video network. This is no problem.
it"s just that after the fake upload is completed, save it directly to the data
. Even if he successfully saved the imported address for URL, it is still / images/download.gif
unless
uploads the address. When he succeeds in attr replacement,
must "move" in the editor, for example, click
and save the incoming data will be the correct network address. What kind of problem is this? No one replied to me at github.