forked from MarseyWorld/MarseyWorld
fix console error
parent
b1281eb010
commit
5a6d5538c4
|
@ -323,8 +323,10 @@ function sendFormXHR(form, extraActionsOnSuccess, upload_prog) {
|
|||
|
||||
const xhr = new XMLHttpRequest();
|
||||
|
||||
if (upload_prog) {
|
||||
upload_prog = document.getElementById(upload_prog);
|
||||
xhr.upload.onprogress = (e) => {handleUploadProgress(e, upload_prog)};
|
||||
}
|
||||
|
||||
formData = new FormData(form);
|
||||
|
||||
|
@ -335,6 +337,7 @@ function sendFormXHR(form, extraActionsOnSuccess, upload_prog) {
|
|||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
|
||||
xhr.onload = function() {
|
||||
if (upload_prog)
|
||||
upload_prog.classList.add("d-none")
|
||||
|
||||
const success = xhr.status >= 200 && xhr.status < 300;
|
||||
|
|
Loading…
Reference in New Issue