T
trpost
I am using the following javascript to resize an iframe to 100% of the
contents, which works good:
<script type="text/javascript">
function autoIframe(frameId){
try{
frame = document.getElementById(frameId);
innerDoc = (frame.contentDocument) ? frame.contentDocument :
frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = innerDoc.body.scrollHeight + 20;
}
catch(err){
window.status = err.message;
}
}
</script>
<iframe id="tree" name="tree" src="Table.php"
onload="if (window.parent && window.parent.autoIframe)
{window.parent.autoIframe('tree');}"
width="100%" frameborder="no" scrolling="no"></iframe>
</iframe>
Now I am including this code into a framework which wraps my iframe
within another iframe, which causes the script to fail:
<frame>
<iframe id="tree" name="tree" src="Table.php"
onload="if (window.parent && window.parent.autoIframe)
{window.parent.autoIframe('tree');}"
width="100%" frameborder="no" scrolling="no"></iframe>
</iframe>
</iframe>
Does anyone know how to adjust the javascript to access the embeded
iframe?
contents, which works good:
<script type="text/javascript">
function autoIframe(frameId){
try{
frame = document.getElementById(frameId);
innerDoc = (frame.contentDocument) ? frame.contentDocument :
frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = innerDoc.body.scrollHeight + 20;
}
catch(err){
window.status = err.message;
}
}
</script>
<iframe id="tree" name="tree" src="Table.php"
onload="if (window.parent && window.parent.autoIframe)
{window.parent.autoIframe('tree');}"
width="100%" frameborder="no" scrolling="no"></iframe>
</iframe>
Now I am including this code into a framework which wraps my iframe
within another iframe, which causes the script to fail:
<frame>
<iframe id="tree" name="tree" src="Table.php"
onload="if (window.parent && window.parent.autoIframe)
{window.parent.autoIframe('tree');}"
width="100%" frameborder="no" scrolling="no"></iframe>
</iframe>
</iframe>
Does anyone know how to adjust the javascript to access the embeded
iframe?