title: I need this jquery/ajax script to run every 30 seconds
body: <p>Now I have been puzzling with this for some time.
  I got part of it together in jquery/ajax:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
      jQuery.ajax({
          type: "GET",
          url: "sessioncheck.php",
          dataType:"json",
          success:function(response){
              if (response) {
                  window.location.href = 'logout.php';
              }
              else {
                  // Process the expected results...
              }
          }
  
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>This works perfectly, but I would like this process to repeat itself every 30 seconds.
  Can someone please help me with that? I have read something about setinterval, but I cant seem to get it to work.</p>
  
  <p>Thanks a lot in advance for all of your help!</p>