title: How to close a facebook SDK dialog opened with FB.ui()?
body: <p>I'm successfully displaying an invite friend dialog (code shown below). When user clicks skip the iframe/dialog shows a new page. However from this point I can't find a way how to close the iframe/dialog. FB.ui doesn't return any object, there doesn't seem to be a Javascript SDK method and traversing and manipulating with the DOM will be brittle to any FB code changes.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>function popupInviteForm(actionUrl) {
      var fbmlString = '&lt;fb:fbml&gt;' +
                '   &lt;fb:request-form type="POST" content="Play against me in game?" action="' + actionUrl + '" method="post" &gt;' +
                '       &lt;fb:multi-friend-selector target="_self" exclude_ids="" max="20" cols="4" rows="3" showborder="false" actiontext="Invite friends!" /&gt;' +
                '   &lt;/fb:request-form&gt;' +
                '&lt;/fb:fbml&gt;';
  
      FB.ui({
          method: 'fbml.dialog',
          fbml: fbmlString,
          display: 'dialog',
          size: {width:640,height:480}, width:640, height:480
      });
  
      $(".FB_UI_Dialog").css('width', $(window).width()*0.8);
  }
  </code></pre>
  
  <p>(Note: I have posted the same question on the <a href="http://forum.developers.facebook.net/viewtopic.php?id=86097" rel="nofollow noreferrer">facebook forum</a> with no response. I will update both, should there be an answer on either.)</p>
  
  <p>The Javascript code was adapted from a stack overflow <a href="https://stackoverflow.com/questions/1781973/facebook-connect-displaying-invite-friends-dialog-and-closing-on-completion/3809066#3809066">answer</a>.</p>