title: Javascript: using setTimeout with window.close() not work after using setTimeout with window.open()
body: <p>I have two setTimeout after another. One to open a webpage in the window and another to close the window after a predetermine amount of time. However, after using setTimeout to open a webpage, the next setTimeout that close the window does not work. The setTimeout with windows.close by itself works fine.</p>
  
  <p>I and trying to opening a window with a message; then open a website in the window after a predetermine amount of time, and then close the window after a couple of more seconds has passed.  Here is my function to do this:</p>
  
  <pre><code>function showNews() {
      news = window.open("", "NewsWindow", "width=900, height=700");
      news.document.write("&lt;p&gt;The 'NewsWindow' will only appearing for 3 seconds.&lt;/p&gt;");
      tmot = setTimeout(function(){news.window.open('http://www.yahoo.com','_self')}, 2000);
      tmot = setTimeout(function(){news.window.close()}, 5000);
  }
  </code></pre>
  
  <p>I tried running on both Chrome and IE and both browser would only execute one of the setTimeout and not the other. Any advice and help would be greatly appreciated!</p>