We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

jamesming on 08/29/08


Tagged

iframe resize


Versions (?)


iframe resize to match frame source using javascript and div innerhtml


Published in: JavaScript 


URL: http://www.webmasterworld.com/forum21/7779.htm

Post a stripped down version of the page if you can. One that shows exactly how the iframe fits into the structure of the page.

The solution I settled on works like this: The parent page has a javascript function like this:

function insertIt() { var _y = document.getElementById('framediv'); var _x = window.frames[0].document.body.innerHTML; _y.innerHTML = _x } Then, the parent page has a div with the id "framediv" which is placed where the contents of the iframe should appear on the page. The iframe element is then placed inside the div, like this: