title: Close a popup modal window of iframe type through a button
body: <p>I have a parent page and child page sharing the same <strong>file.js</strong> file for <em>jquery</em> events.</p>
  
  <p>Well I am working with <code>Magnific Popup</code> and I have:</p>
  
  <pre><code>$("#addDetailButton").magnificPopup({
          items: {
                src: 'someURL'
          },
          type: 'iframe',
          enableEscapeKey: false,
          modal: true
  
  });
  </code></pre>
  
  <p>My popup is based on <code>iframe</code> and is <code>modal</code>. How I can close the modal window with a <code>button</code> html element? I did a research on StackOverflow and all the replies and based in <code>inline</code> type.</p>
  
  <p>I have tried</p>
  
  <pre><code>&lt;input id="cancel" type="button" value="Cancel"/&gt; // child page
  
  $("#cancel").click(function(){
          $.magnificPopup.close();
  });
  </code></pre>
  
  <p>and I always receive trough Firefox's Web Console the following:</p>
  
  <pre><code>TypeError: $.magnificPopup is undefined
  </code></pre>
  
  <p>Thank You</p>