Just running some browser tests to troubleshoot - everything's smooth sailing until this line is reached:
responseJson = JSON.parse(localReq.responseText);
So, when I evaluate JSON.parse(localReq.responseText), the correct value comes through. But as soon as I try to evaluate "responseJson," it throws an uncaught reference error and I can't pinpoint why.
function login()
{
userName = document.getElementById("_name").value;
password = document.getElementById("_password").value;
data = "userName=" + userName + "&" + "password=" + password;
localReq = new XMLHttpRequest();
localReq.open("POST", "http://universe.tc.uvu.edu/cs2550/assignments/PasswordCheck/check.php", true);
localReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
localReq.send(data);
response = document.getElementById("_login");
if (localReq.status == 200)
{
responseJson = JSON.parse(localReq.responseText);
}
}