Create iframes from original page content
I am trying to dynamically "rewrite" an entire page to a set of iframes. I want a music player bar at the bottom iframe and the original page "rewritten" in an iframe above/behind that. Almost just like
SMC player. I feel like I'm close but I am a jQuery novice.. So any pointers will be greatly appreciated beforehand.
Here's the main part that creates the iframes that's not working correctly.
- var oldpage = "<html>" + $("html").html() + "</html>";
- $('body').html( "<iframe frameborder='0' id='content' allowtransparency='true' name='content'></iframe>" );
- $('#content').contents().find('html').html(oldpage);
- $('body').append("<iframe id='stratus' allowtransparency='true' frameborder='0' scrolling='0'>");
I'm trying to load the entire original html on line 1. Then creating iframes and trying to inject the oldbody variable into the new iframe #content. The iframes are created but the #content iframe has a blank body.