title: Attach an event in a child iframe to a handler in the parent window
body: <p>I don't have access to this iframe's source directly, so I would like to do this, if it's possibly this way.</p>
  
  <p>I have an iframe generated by JS:</p>
  
  <pre><code>&lt;iframe name="temp_iframe" width="100%" height="95%" src="'+the_url+'"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>And inside is a submit button and a cancel button. The submit button works fine, but I want the cancel button to close this modal that is containing the iframe... I also want the submit button to send, <em>then</em> close the modal. Normally this would be easy, but im not sure how to setup an event in the parent window to a child DOM element of the iframe that affects the child's parent, the main window.</p>
  
  <p>E.g. if this wasn't in an iframe and in jQuery:</p>
  
  <pre><code>$('[name=temp_iframe] button').live('click',function(){
      alert('click');
      return false;
  });
  </code></pre>
  
  <p>EDIT: And also, it's on the same domain!</p>