title: Ajax time interval call to a php function
body: <p>I have an ajax code that calls a php file:</p>
  
  <pre><code>function ajaxRequest(){
  var requestData; 
  
  try{
      // Opera 8.0+, Firefox, Safari
      requestData = new XMLHttpRequest();
  } catch (e){
      // IE
      try{
          requestData = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
          try{
              requestData = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (e){
              // Your browser is brokeded.
              alert("Please try again later!");
              return false;
          }
      }
  }
  // Send/receive data
  requestData.onreadystatechange = function(){
      if(requestData.readyState == 4){
          document.getElementById("testDiv").innerHTML = requestData.responseText;
      }
  }
  requestData.open("GET", "tester.php", true);
  requestData.send(null); }
  </code></pre>
  
  <p>What I actually want the code to do is to call a php function on the same page at time intervals. I intend to display a notification with it on adding a new row to a table in a mysql database. Please, help me edit this code or probably a new one if the above is not okay. I will appreciate the help. Thank you</p>