![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
|
Resizing Iframe via PHP
I have created an iframe in an HTML file that pulls up a PHP file & have a javascript code that will automatically resize the Iframe according to it's content. The problem is that the code I have requires the use of an onload event handler utilized in a body tag, & the PHP file contains some header information, which is causing errors.
The warning states that the PHP file can't utilize it's header information because it has already been called (I imagine from the onload event handler). Is there any way around this? The code in the HTML file looks like so: <iframe name="main" id="dynamIframe" src="home.html" height="*" scrolling="no" width="100%" frameborder="0"></iframe> Then the code (in HTML format) that I am attempting to use in the PHP looks like so (yes, I have to convert it... that's not the problem): <script> function resizeToContent(){ var x =0; var y =this.document.body.scrollHeight; while (x < y){ x+=1; } parent.document.getElementById("dynamIframe").style.height=x+20 } </script> <body onload="resizeToContent()"> Again, I can get the code to work in PHP, but when loaded it pops up with several warnings about the header information. If you need to see what the actual warning says I can get that information to you, but am limited on time at the current moment. Thanks for any help! |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Design Team
Join Date: Mar 2006
Location: Philadelphia
Posts: 1,541
OS: Windows Vista Home Premium (x64)
|
Have you tried removing the onload function just to see if it is the problem?
__________________
Nice music blog ![]() Nvu || Notepad++ || Apache || PHP || Keep TSF Alive "The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier." |
|
|
|
|
|
#4 (permalink) |
|
Design Team
Join Date: Mar 2006
Location: Philadelphia
Posts: 1,541
OS: Windows Vista Home Premium (x64)
|
Try changing onload to onmouseover.
__________________
Nice music blog ![]() Nvu || Notepad++ || Apache || PHP || Keep TSF Alive "The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier." |
|
|
|
![]() |
| Thread Tools | |
|
|