m8rix
asked on
change iFrame height from child function
Can you change an iFrame height dimensions from a function with-in the child frame?
I am doing a page on my work intranet which is only updateable via an online tool which lets you write HTML (only within the <BODY> tags), but strips out any JavaScript.
I can however use small amounts of JavaScript using onload, onclick, onmouseover... elements etc...
So I have imbedded an iFrame on the page which is just a dynamic table, but because I don't know how long the table will be, it causes scrollbar to appear.
I tried to change this from the onload element of the iFrame by doing this:
<IFRAME onload="this.style.pixelHe ight=this. scrollHeig ht;" style="OVERFLOW: auto; WIDTH: 100%;height:;" src="mytablehtml.asp" frameBorder=0></IFRAME>
But for some reason this does not work??
So I would like to include a function inside the child frame that will test how tall it is and tell it's parent to resize if possible.
*** OR ***
Would like to have my current method corrected if wrong.
Reg's
m8rix
I am doing a page on my work intranet which is only updateable via an online tool which lets you write HTML (only within the <BODY> tags), but strips out any JavaScript.
I can however use small amounts of JavaScript using onload, onclick, onmouseover... elements etc...
So I have imbedded an iFrame on the page which is just a dynamic table, but because I don't know how long the table will be, it causes scrollbar to appear.
I tried to change this from the onload element of the iFrame by doing this:
<IFRAME onload="this.style.pixelHe
But for some reason this does not work??
So I would like to include a function inside the child frame that will test how tall it is and tell it's parent to resize if possible.
*** OR ***
Would like to have my current method corrected if wrong.
Reg's
m8rix
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for that, my two pages are on different domains :(
Is there any attributes you can get using:
document.frames.myiframe.d ocument.bo dy.SomeAtt ribute
I tried to read the innerHTML of the iFrame and got the same error.
Also, because I created the page that is included in the iFrame, can I change the security of the page somehow to allow the parent to read it?
Is there any attributes you can get using:
document.frames.myiframe.d
I tried to read the innerHTML of the iFrame and got the same error.
Also, because I created the page that is included in the iFrame, can I change the security of the page somehow to allow the parent to read it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thankyou... All comments made were very good. Thus leaving behind a great reference for the future.
reg's
m8rix
reg's
m8rix
thank you too!
thx :-)
ASKER