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();
|
const xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
upload_prog = document.getElementById(upload_prog);
|
if (upload_prog) {
|
||||||
xhr.upload.onprogress = (e) => {handleUploadProgress(e, upload_prog)};
|
upload_prog = document.getElementById(upload_prog);
|
||||||
|
xhr.upload.onprogress = (e) => {handleUploadProgress(e, upload_prog)};
|
||||||
|
}
|
||||||
|
|
||||||
formData = new FormData(form);
|
formData = new FormData(form);
|
||||||
|
|
||||||
|
@ -335,7 +337,8 @@ function sendFormXHR(form, extraActionsOnSuccess, upload_prog) {
|
||||||
xhr.setRequestHeader('xhr', 'xhr');
|
xhr.setRequestHeader('xhr', 'xhr');
|
||||||
|
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
upload_prog.classList.add("d-none")
|
if (upload_prog)
|
||||||
|
upload_prog.classList.add("d-none")
|
||||||
|
|
||||||
const success = xhr.status >= 200 && xhr.status < 300;
|
const success = xhr.status >= 200 && xhr.status < 300;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue