Głowię się i głowię i nie mogę dojść gdzie jest błąd. readyStatus wywala mi ciagle 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl-PL">
<meta http-equiv="Content-Type" content="text/html; charset=utf8" /> .a{
width:400px;
height:50px;
border: 2px solid #000;
margin-top: 25px;
line-height: 2.5em;
}
<script type="text/javascript"> function getXMLHttpRequest()
{
var request = false;
try
{
request = new XMLHttpRequest();
}
catch (err1)
{
try
{
request = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (err2)
{
try
{
request = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (err3)
{
request = false;
}
}
}
return request;
}
function processResponse()
{
if (r.readyState == 4)
{
if (r.status == 200)
{
document.getElementById('pokaz').innerHTML = r.responseText;
};
}
else
{
document.getElementById('pokaz').innerHTML = r.readyState;
}
}
function odczytaj()
{
r.open("GET", "cos.php?id=" + Number(new Date), true);
r.onreadystatechange = processResponse();
r.send(null);
}
var r = getXMLHttpRequest();
<body><div align="center" id="pokaz" class="a" onmouseover="java script:odczytaj();" ></div></body>