text: Q:
  
  Whats wrong with my ajax request?
  
  <script type="text/javascript">
  var t;
  function tick() {
    xmlhttp=new XMLHttpRequest();
    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4 && xmlhttp.status==200 && document.getElementById("txtHint").innerHTML!=xmlhttp.responseText) {
          document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
      }
    };
    xmlhttp.open("GET","http://ubarskit.com/v/response.php",true);
    xmlhttp.send();
    t=setTimeout("tick()",1000);
  }
  </script>
  </head>
  <body onload="tick()"> 
  <span id="txtHint"></span>
  </body>
  
  I want it to update the text in the span-tag from response.php every second.
  Works in chrome, but not in Firefox or Opera.
  Here's the response.php file:
  <?php
  if(isset($_GET['ropa']))
    {
      $fp = fopen('shout.txt', w);
      fwrite($fp, $_GET['ropa']);
      fclose($fp);
    }
  else
    {
      echo file_get_contents('shout.txt');
    }
  ?>
  
  A:
  
  Instead of doing it like real men, I used jQuery ;)
  <script type="text/javascript">
  function tick() {
  $.get('response.php',function(data) {
    $('#txtHint').html(data);
  });
  }
  function submitShout(form){
  $.get('response.php',{ ropa: form.elements['ropa'].value});
  }
  </script>
  </head>
  <body onload="window.setInterval('tick()',1000)"> 
  <span id="txtHint"></span>
  <form action="response.php" method="get" onsubmit="submitShout(this); return false;">
    <input type="text" id="ropa" name="ropa">
  </form>
  
  