JQuery script uses a lot of memory

I have the code below on the social networking site, it uploads a file that shows users new notifications, if they exist.

The problem is that for some time I leave the page open, it eventually consumes too much memory on my PC and starts to make firefox not respond and gives an error message indicating that the memory is getting low and asks if should I abort the script or something in that direction.

Is there a way to do what I have, but not use so much memory in time?

<script type='text/javascript'> 
$(document).ready(function(){ 
     var updatenotification = function(){ 
          $('#notificationcontainer') 
               .load('http://localhost/member/beta_new/notifications.inc.php') 
               .fadeIn("slow"); 
     }; 
     var auto_refresh = setInterval(function(){updatenotification();}, 60000); 
     updatenotification(); 
}); 
</script>
+3
source share
1 answer

. , ish dom. , json, , , div, , , . , , .

, , . html-, . script , .

, firebug . , ajax/js, StackOverflow, Netvibes. ( !) firebug,

+1

Source: https://habr.com/ru/post/1713404/


All Articles