Подскажите почему я не могу вернуть значение responseText из onreadystatechange и как вообще это можно организовать. буду рад любым подсказкам. спасибо.
var url = "";
function openProgressBar() {
uuid = "";
for (i = 0; i < 32; i++) {
uuid += Math.floor(Math.random() * 16).toString(16);
}
req.open("GET", "upload.php", true);
req.onreadystatechange = updatePage;
req.send(null);
document.getElementById("upload").action= url + "?X-Progress-ID=" + uuid;
....
}
function updatePage() {
if ((req.readyState == 4)&&(req.status == 200)) {
url = req.responseText;
}
}