title: problem opening a link within an setInterval?
body: <p>I don't understand why trying to open a link through <code>window.open()</code> does not work after the second interval?</p>
  
  <p>In the example I show below, the link opens correctly without any problem due to the first interval.</p>
  
  <pre><code>var c=1;
  
  var op='';
  
  var i = setInterval(function(){
     if(c==1){
       op = window.open(link);
     }
     c++;
  },2000);
  </code></pre>
  
  <p>however if I try it in the second interval as I show below, just ignore 'window.open()' completely</p>
  
  <pre><code>var c=1;
  
  var op='';
  
  var i = setInterval(function(){
     if(c==2){
       op = window.open(link);
     }
     c++;
  },2000);
  </code></pre>
  
  <p>Why is this and how could I solve it?</p>