jQuery - Trigger event from within iFrame on parent document
<p>Is there any reason why this is not working:</p>

<p><strong>Parent document</strong></p>

<pre><code>$(document).ready(function($) {
        $('.upload-media').click(function(){
            if( $(this).parent().find('iframe')[0] )
                return false;
            $(this).parent().append('&lt;iframe class="media-iframe" src="'+this.href+'"&gt;&lt;/iframe&gt;');
            var ifr = $(this).parent().find('iframe');
            $(document).bind('closeFrame', function(){ alert("event"); });
            return false;   
        }); 
    });
</code></pre>

<p><strong>iFrame</strong></p>

<pre><code>$(document).ready(function() {
    $("#media-frame-close").click(function(){
        window.parent.$(window.parent.document).trigger('closeFrame');
        return false;
    });
});
</code></pre>

<p>Seems pretty straight forward, I've tried parent. instead of window.parent and that isn't working either :(</p>
