I\'m trying to create a Facebook Connect application that displays a friend invite dialog within the page using Facebook\'s Javascript API (through a FBMLPopupDialog).
I found that if you specify target="_self" in the request-form element (not in the friend selector, as Domenic suggests), the response url will load in the iframe, and not reload the whole page.
Thus, you could load your own prompt to close the window at this point, or with a little bit more work send a message to the parent to close the whole iframe automatically.