title: Triggering a jQuery event from iframe
body: <p>Here's the scenario, I have events happening from within an iframe and up until now everything is working well. I just ran into the problem where I want to dispatch an event from the iframe to the parent. </p>
  
  <p>I'm using this to trigger the event from the iframe:</p>
  
  <pre><code>$('body', window.parent.document).trigger('eventName');
  //and I've also tried
  $(window.parent.document).find('body').trigger('eventName');</code></pre>
  
  <p>And then in the parent page I've listening for the event like this:</p>
  
  <pre><code>$('body').bind('eventName', myFunction)</code></pre>
  
  <p>I know the script gets to the trigger because I stuck a <code>console.log</code> before and after the trigger. The iframe is on the same domain so there is no problem there.</p>
  
  <p>I can call a function on the parent page directly like this: <code>window.parent.functionName</code> but I was wondering if this is possible with using using an event based solution.</p>
  
  <h2>Solved</h2>
  
  <p>@cwolves answer is working great:</p>
  
  <pre><code>parent.$('body').trigger( 'eventName' );
  </code></pre>