title: Page freezes while ajax working
body: <p>When I use ajax with jquery, page freezes while ajax working and then after 3-4 seconds, data received. I set time interval on the ajax function to run again and again after few seconds and that make my page very slow.</p>
  
  <p>How can I prevent this?</p>
  
  <p>Code that I use is given below.</p>
  
  <pre><code>    function show_clt() {
          $.ajaxSetup({
              async: true
          });
          $.ajax({
              type: "GET",
              url: "online_clients.php",
              //data: dataString,
              cache: false,
              success: function(html) {
                  $("#online_clients").html(html);
              } 
          });
          var dataString = "e_id=&lt;?=$employer_id; ?&gt;";            
          $.ajax({
              type: "GET",
              url: "online_employer.php",
              data: dataString,
              cache: false,
              success: function(html){
                  $("#online_employer").html(html);
              }
          });
      }
  
      show_clt();
      setInterval(function() {
          $.ajaxSetup({
              async: true
          });
          //var di_scroll = $('#client_main').scrollTop(); alert(di_scroll);
  
          $.ajax({
              type: "POST",
              url: "online_clients.php",
              //data: dataString,
              cache: false,
              success: function(html) {
                  $("#online_clients").html(html);
                  //$('#client_main').scrollTop(60);
              } 
          });
          var dataString = "e_id=&lt;?=$employer_id; ?&gt;";
          $.ajax({
              type: "POST",
              url: "online_employer.php",
              data: dataString,
              cache: false,
              success: function(html) {
                  $("#online_employer").html(html);
              }
          });
      }, 9000);
  </code></pre>