Ok basically here is my problem and I can’t find anything about it on this site or any site. I am using Ajax for refreshing a include php file and its keeps refreshing on itself.Basically the first refresh is fine 10 seconds then this happens the second refresh is 5 seconds while refreshing on itself, then the next about 2 seconds doing same thing, and goes down to the 1 second. I don’t know what is wrong why its doing this.
This is the code for refreshing. I am not doing the rest of the code. I know this is where the problem is because it causes the refreshing itself.
<script>
$("#active").load("active.phps");
setInterval(function(){
$("#active").load("active.php");
}, 10000);
</script>
Anyone can help I would be grateful. This is to help tell what friends you have online, and with this it slows down performance on my site and on my computer.
add the added lines to the beginning and end of your script:
this runs the scriptafter everything is finished loading. So it waits basically.