<script>
var xmlHttp = new XMLHttpRequest();
function updateVhod(){
var url = "modules/registration/testreg.php?r="+Math.random();
var params = 'login=' + encodeURIComponent(login) + '&password=' + encodeURIComponent(parssword);
xmlHttp.open("POST",url,true);
xmlhttp.setRequestHeader('Content-Type', 'text/html');
xmlHttp.send(params);
document.getElementById("result").innerHTML='<center><img class="loading" src="img/loading.gif"></center>';
xmlHttp.onreadystatechange = redrawvhod;
return false;
}
function redrawvhod(){
if (xmlHttp.readyState==4){
var response = xmlHttp.responseText;
document.getElementById("result").innerHTML=response;
}
}
</script>
<form onsubmit="return updateVhod()" method="post">
<input name="login" type="text" size="15" maxlength="15">
<input name="password" type="text" size="15" maxlength="15">
<input type="submit" value="отправить">
<div id ="result"></div>
Помогите ошибку найти, уже 2 часа мучаюсь