Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Interval bug

  • Loading branch information...
commit fedcc69e228bd02b93df45f012bd36a499885c8e 1 parent b5223aa
Brian Klug authored January 25, 2011

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  static/main.js
5  static/main.js
@@ -14,12 +14,15 @@ function refreshPage() {
14 14
   $.ajax({
15 15
     url: '/',
16 16
     success: function(data) {
  17
+      if (window.oldint) {
  18
+        clearTimeout(window.oldint);
  19
+      }      
17 20
       $('#body').html(data);
18 21
     }
19 22
   });
20 23
 }
21 24
 
22 25
 $(document).ready(function(){
23  
-    setInterval(refreshPage,3 * 60 * 1000);
  26
+    window.oldint = setInterval(refreshPage,3 * 60 * 1000);
24 27
     letsDance();
25 28
 });

0 notes on commit fedcc69

Please sign in to comment.
Something went wrong with that request. Please try again.