title: Listen events in iframe by parent
body: <p>I'm trying to trigger this event:</p>
  
  <pre><code>$("body").trigger({
                  type: 'Edge_Plantilla_ClosePopup',
                  sym: sym,
                  evt: e
              });
  </code></pre>
  
  <p>and the element is on an iframe with a random id.</p>
  
  <p>In parent i'm listening the event like:</p>
  
  <pre><code>$("body").on("Edge_Plantilla_ClosePopup", function (evt) {
          play_buttons();
          close_popup();
          console.log("close");
      });
  </code></pre>
  
  <p>But it's doing nothing. I'm pretty sure that is something about the iframe but idk how can I listen the trigger.</p>
  
  <p>EDIT:</p>
  
  <p>This is my project: 
  Main:
  <a href="http://i.imgur.com/hx2jOHG.png" rel="nofollow">http://i.imgur.com/hx2jOHG.png</a></p>
  
  <p>Child:
  <a href="http://i.imgur.com/Qap49M0.png" rel="nofollow">http://i.imgur.com/Qap49M0.png</a></p>
  
  <p>EDIT:</p>
  
  <p><strong>I just found a solution!</strong></p>
  
  <p>parent.html</p>
  
  <pre><code>$(document).on('Edge_Plantilla_ClosePopup', function(e) {
        //etc.
  });
  </code></pre>
  
  <p>iframe.html</p>
  
  <pre><code>parent.$(parent.document).trigger({
                      type: 'Edge_Plantilla_ClosePopup',
                      sym: sym,
                      evt: e
                  });
  </code></pre>
  
  <p>and it's working correctly. The trick is to just use the jquery from the parent</p>