I tried playing with AJAX a bit. This is just the chunk of JavaScript I got.
// FIRST TIME REQUIREMENT
var interAction = new XMLHttpRequest();
var responseAJAX;
interAction.onreadystatechange = function() {
if (interAction.readyState == 4 && interAction.status == 200) {
alert(interAction.responseText);
responseAJAX = interAction.responseText;
}
}
alert("inside");
interAction.open("GET", "ss-controller.php?req=freshStart", true);
interAction.send();
alert("This is my response: " + responseAJAX);
Firstly I thought that interAction.onreadystatechange = function()
encapsulated the variable, but I did declare it in global scope (second row). I do get "testxxx" as response from alert(interAction.responseText);
and then I get "This is my response: undefined" from last row.