is there a better way to write this code to avoid server problem if
the site gets a lot of visitors ?

(keeping the "live" stats)

<script>

// the call for the update (it just change an entry in the db total =
total + 1;
        function autoupdate() {

        $.post("count.php", {count:1},
  function(data){
   $("#counter").html(data);
  });}

// the 1 sec interval
  $(document).ready(function() {
    setInterval("autoupdate()", 1000);
  });
  </script>

Reply via email to