Hi Michel,
My $.03... I would:
1- declare c and loIFrame as var otherwise JavaScript adds them as properties to the Global Object,
2- make sure iframe exist, just in case ...,
3- use a frameWork such as jQuery or Prototype (my favorite) to be sure code is cross-browser...
Sample code with prototype.js v 1.7
function ResizeIFrame(tcIFrame)
{
var loIFrame = $(tcIFrame);
if (loIFrame) loIFrame.height = loIFrame.getHeight()+17+'px';
}
thn
>This is a much simpler version:
>
>
>function ResizeIFrame(tcIFrame)
>{
> loIFrame=document.getElementById(tcIFrame)
> c=(loIFrame.contentWindow || loIFrame.contentDocument)
> loIFrame.height=parseFloat(c.document.body.scrollHeight || c.scrollHeight)+17
>}
>
>
>And, it works.
>
>I am just trying to figure out a better way to lay out that function in regards to the last two lines. If someone has an idea on how to better formulate that that it would be more readable, that would be appreciated.
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/Never explain, never complain (Queen Elizabeth II)