Głowię się i głowię i nie mogę dojść gdzie jest błąd. readyStatus wywala mi ciagle 1

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="pl-PL">
  3.  
  4. <head>
  5. <title>...</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf8" />
  7. .a{
  8. width:400px;
  9. height:50px;
  10. border: 2px solid #000;
  11. margin-top: 25px;
  12. line-height: 2.5em;
  13. }
  14. </style>
  15.  
  16. <script type="text/javascript">
  17. function getXMLHttpRequest()
  18. {
  19. var request = false;
  20.  
  21. try
  22. {
  23. request = new XMLHttpRequest();
  24. }
  25. catch (err1)
  26. {
  27. try
  28. {
  29. request = new ActiveXObject('Msxml2.XMLHTTP');
  30. }
  31. catch (err2)
  32. {
  33. try
  34. {
  35. request = new ActiveXObject('Microsoft.XMLHTTP');
  36. }
  37. catch (err3)
  38. {
  39. request = false;
  40. }
  41. }
  42. }
  43. return request;
  44. }
  45.  
  46.  
  47. function processResponse()
  48. {
  49. if (r.readyState == 4)
  50. {
  51. if (r.status == 200)
  52. {
  53. document.getElementById('pokaz').innerHTML = r.responseText;
  54. };
  55. }
  56. else
  57. {
  58. document.getElementById('pokaz').innerHTML = r.readyState;
  59. }
  60.  
  61. }
  62.  
  63. function odczytaj()
  64. {
  65. r.open("GET", "cos.php?id=" + Number(new Date), true);
  66.  
  67. r.onreadystatechange = processResponse();
  68.  
  69. r.send(null);
  70. }
  71.  
  72. var r = getXMLHttpRequest();
  73.  
  74.  
  75. </script>
  76. </head>
  77.  
  78. <body><div align="center" id="pokaz" class="a" onmouseover="java script:odczytaj();" ></div></body>
  79.  
  80. </html>