In Google chrome and Firefox my script works wonders. It looks amazing!
However, in internet explorer there seems to be a minor problem.
Once a login credential has been submitted (e.g. Username: hi, Password: hi) you cannot submit the form again with the same credentials. Seems like a security thing IE does so it's not viewing the same web page as before.
Code:
function check_credentials(){
httpObject = getHTTPObject();
if (httpObject != null) {
httpObject.open("GET", "/xatron/login.php?username="+escape(document.getElementById('username').value)+"&password="+escape(document.getElementById('password').value), true);
httpObject.send(null);
httpObject.onreadystatechange = function() { setOutput(); }
}
}
function setOutput(){
if(httpObject.readyState == 4){
// alert(httpObject.readyState); *** This is a test line...
login_run(httpObject.responseText);
}
}
function login_run(login_answer){
login_answer = login_answer;
if(login_answer == 0){
// alert false
}else{
document.location.href='/xatron/welcome.php';
}
And the form:
<table width="90%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%">Username:</td>
<td width="50%"><input type="text" id="username" /></td>
</tr>
<tr>
<td width="50%">Password:</td>
<td width="50%"><input type="password" id="password" /></td>
</tr>
</table>
I am using jquery for the submit, but it's not the jquery giving the problems, it's the AJAX. any advice? Should "get" be "post" maybe?! Not sure.