I'm using the following jQuery code within an iframe (same origin) to try to move a node from the iframe to the main (top) document.
var dest = $(window.top.document).find('#dest_id');
dest.append($('#source_id'));
The following works ok:
window.top.document.getElementById('dest_id').innerHTML = document.getElementById('source_id').innerHTML;
I guess there is a limitation in moving DOM nodes between frames. Is there any way around this either in plain js or in jquery?
Edit:
Could it be something to do with the ownerDocument
property? I tried changing it to window.top.document
on #dest_id but it didn't work.
Edit, similar question: http://stackoverflow.com/questions/2284356/