var formData = new FormData ();
formData.append ("image", document.getElementById ("FileUpload"). Files [0]);
$.ajax ({
url: url,
type: "post",
data: formData,
cache: false,
/**
*falseContent-Type
*/
contentType: false,
/**
* falsejQuery formdata
* XMLHttpRequest formdata
*/
processData: false,
success: function (data) {
console.log(data)
if (data.code == "200") {
this.imageUrl = data.data
}
}
})
cannot get the path outside ajax, so this.imageUrl ="
appears. Why? Who has encountered similar problems?