Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Forms Inputs

Jim Sweeney
Jim Sweeney
3,050 Points

iFrame use

Just out of curiosity... can I use an iFrame to display information from another website. For instance, with my job, we often need to monitor multiple websites and flipping back and forth between 6 or 8 sites can be annoying. Can I use an iFrame to put them all on one page??

1 Answer

Richmond Lauman
Richmond Lauman
28,793 Points

You can reference pages from other sites using iframes (unless a site you are trying to reference specifically takes measures to prevent doing so). You would need a separate iframe element for each site is you wanted all sites viewable at the same time on pne page, or you could write a script that takes user input using a form to dynamically change the file location in the iframe when different buttons are clicked or options are chosen. That might be a useful thing to have for your own use. If you used PHP to have dynamic navigation between sites in the iframe you would need to set up server software with PHP installed on your computer in order to be able to run it from your computer. If you just. Alternatively you could make a separate html file with an iframe for each page you wanted to view and on each page include links to the other pages. If you did that you could have the files stored in your document folder somewhere and navigate between view without having to have server software with PHP installed.

Mind you, I am not at all certain if this is something you or anyone should do. I am just saying it can be done.