My preliminary code to do this is something like this.
$j(document).ready(function() {
var w = window.open(childPage);
$j(w.document).ready(function() {
$j('#DestinationElement', w.document).html($j('#SourceElement').html());
});
});
However, this only works for me when I set a breakpoint on the html injection statement, meaning that it's not really waiting for the child window to be ready before doing the injection.
Can somebody fix this? Thanks.
Here are some alternatives: attach an event listener to the window onload event. Waiting for child window loading to complete (but in IE you would use attachEvent to 'onload')
In the child window itself, get the opener's html when the document is ready.
But it still bothers me that I don't see why the original solution fails.