What I'm trying to do is wrap a complete website in an iframe
without breaking any styling or javascript.
This is what I've tried:
var $frame = $('<iframe />').css({
position: 'fixed',
top: 0,
left: 0,
width: '100%',
height: '100%'
}).appendTo('body');
$('head').children().appendTo($frame.contents().find('head'));
$('body').children().not($frame).appendTo($frame.contents().find('body'));
See http://jsfiddle.net/gUJWU/3/
This works fine in Chrome.
Firefox seems to swallow the whole page.
Internet Explorer (see http://jsfiddle.net/gUJWU/3/show/) does create the iframe
, doesn't move anything into it.
Does this approach have any chance of working cross-browser?