View Full Version : auto height iframes and displaying other websites content in them

05-13-2007, 06:48 PM
I am building a website that has to use frames. i have spent most of the day looking for a cross browser iframe script that has an auto height function BUT can also display pages from other websites. from what i have seen loading content in a iframe outside the root from another domain/website is a technical song and dance.

can anyone provide some useful ideas or links. ideally i am looking for a light piece of code, what i have found is the size of war and peace.

05-13-2007, 07:01 PM
Using javascript alone is not possible due to cross domain security reasons. You might be able to use file_get_contents using php and just echo out what you get into the iframe. This will be okay on first load but links won't work unless they are absolute links and images won't work either for the same reason. You would need to make all of the images and links absolute for this to work properly. Once everything is echoed on your own server you should be able to resize the iframe using javascript. Good luck.