Reference parent window document

I am trying to access a parent window document from a popup.

<script type='text/javascript'>
    $(document).ready(function(){
        var summary = window.parent.document.getElementById('summary');
        var content = summary.innerHTML;
    });
</script>

Is it possible? Is there a jQuery way to do this?

thanks

+5
source share
3 answers

You do window.openernot want window.parent(for frames).

+12
source

You can use the context to access it:

<script type="text/javascript">
    $(document).ready(function(){
        var content = $("#summary",window.opener.document).html();
    });
</script>
+3
source

window.open(...), window.opener

+2

All Articles