Answer the question
In order to leave comments, you need to log in
How to make xmlhttprequest progress bar JS?
function AppGetDataF1(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
xhr.send();
if (xhr.status != 200) {
return false;
} else {
return xhr.responseText;
}
}
Answer the question
In order to leave comments, you need to log in
function AppGetDataF1(url) {
document.getElementById('ID_ELEMENT_LOADER').style.display = "block";
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
xhr.send();
if (xhr.status != 200) {
document.getElementById('ID_ELEMENT_LOADER').style.display = "none";
return false;
} else {
document.getElementById('ID_ELEMENT_LOADER').style.display = "none";
return xhr.responseText;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question