Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
</body>
</html>
 
//global timeouts
var a = setInterval(function(){
  $("body").append("A <br>");
},500);
b = setInterval(function(){
  $("body").append("B <br>");
},500);
function local() {
    var c = setInterval(function () {
        $("body").append("C <br>");
        setTimeout(function () {
            clearInterval(c);
        }, 3000);
    }, 500);
}
(function(){
  local();
}());
setTimeout(function(){
  clearInterval(a);
},3000);
setTimeout(function(){
  clearInterval(b);
},3000);
$(document).ready(function(){
  //setTimeout to wait for intervals a and b to begin
  var record = setTimeout(function(){
    
    //can see the interval variables if they are global
    //and i print all the global variables
    //http://stackoverflow.com/a/8369361/1252748
    console.dir(Object.keys( window ));
    
  }, 600);
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers