see the function handlestatechange, i’d like to pass the variable ‘day’ from my startrequest function to the handlestate function. the problem is that when handlestatechange is called, it’s not called like a normal function with the ()
without the (), how else would i get an external variable into the handlestatechange function?
[CODE]function startRequest(day, month) {
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open(“GET”, “eventDetails.php?day=”+day+”&month=”+month+”&teamid=<?echo $teamid;?>”, true);
xmlHttp.send(null);
}
function handleStateChange() {
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
alert(“The server replied with: ” + xmlHttp.responseText);
}
}
}