title: Close jQuery popup (external page) window
body: <p>Setup:</p>
  
  <p>Popup Page:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;popup page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;label for="txtArea"&gt;Comments:&lt;/label&gt;
          &lt;textarea id="txtArea" type="text" rows="5" cols="25"&gt;
          &lt;/textarea&gt;
          &lt;input type="submit" value="submit" /&gt;&amp;nbsp;
              &lt;input type="button" value="cancel" /&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Main Page:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;popup page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;a href="#" id="lnkPopup"&gt;Post Comment&lt;/a&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Problem:</p>
  
  <p>I want to open the popup page on clicking of link in main page. This is easily achievable with so many awsome jQuery plugins, but tht problem is that I want to close the popup when user clicks <code>submit</code> or <code>cancel</code> button. How can I achieve this? I have seen exemples where another block from same page is shown and we have <code>IDs</code> of elements in it but not the external page.</p>