Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts

    auto height iframes and displaying other websites content in them

    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.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •