title: jQuery not closing window
body: <p>I'm making a form for an e-commerce site for the user to request a PDF about an item.
  The form works fine and sends the user to the "Thanks" page.
  On the thanks page I have jQuery set an interval to close the window after 5 seconds.
  But it does not work, neither does embedding the close command in a link.
  However, the interval will work if the "Thanks" page opens in a new tab.</p>
  
  <p>Here is the code in the php file (gets called after form has been successfully submitted).</p>
  
  <pre><code>/* Results rendered as HTML */
  
      $theResults = &lt;&lt;&lt;EOD
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;title&gt;Thanks&lt;/title&gt;
  &lt;script type="text/javascript" src="css/00000001/jquery-1.4.2.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready(function()
  {
      //wait a few seconds and close the window
      setInterval(function()
      {
          window.close();
      }, 5000);
  });
  
  &lt;/script&gt;
  &lt;style type="text/css"&gt;
  body{
      background-color: transparent;
      margin: auto auto auto auto;
      border: none;
  }
  
  #general-copy{
      background-color: transparent;
      margin: -5px auto auto 0px;
      position: absolute;
      width: 300px;
      height: 350px;
      padding: 0px 15px 15px 15px;
      font-family: Georgia, "Times New Roman", Times, serif;
      font-size: 14px;
      font-style: normal;
      font-variant:normal;
      font-weight:100;
      text-align: justify;
      z-index: 3;
  }
  
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;div class="lettertext"&gt;
  Thank you for your request.&lt;br /&gt;
  We will email you a pdf all about $item2Field.
  &lt;br&gt;&lt;br&gt;
  &lt;p style="font-size: 10px;"&gt;This window should close itself in 5 seconds.&lt;br&gt;
  If it doesn't please click &lt;a href="javascript:window.close()"&gt;here&lt;/a&gt; to return to the site.
  &lt;/p&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  EOD;
  echo "$theResults"; 
  
  
  ?&gt;
  </code></pre>
  
  <p>If you wish to see this running live you can try it out <a href="http://ecofirstart.com/mm5/request-info.html" rel="nofollow">here</a>.</p>