Reputation: 4648
I'm trying to access the 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 even possible? Is there a jQuery specific way to do it?
Thanks
Upvotes: 5
Views: 12099
Reputation: 33
You can use context to accessed it:
<script type="text/javascript">
$(document).ready(function(){
var content = $("#summary",window.opener.document).html();
});
</script>
Upvotes: 3
Reputation:
If you opened the window with window.open(...), check out window.opener
Upvotes: 2