Log in

View Full Version : IFrame question



gutzs
10-02-2008, 02:28 AM
I've been using HTML to make sites for some time now, and I have the same problem with every site I make - My navigation bars are very tedious to update, because i have to go through page after page to change the bar so that it's the same on every page.

To change this, I decided to put my sidebar in an IFRAME and make it look seemlessly like part of the page. Silly me, I thought that if someone clicked on a link in the iframe that it would follow the link in the same window that CONTAINED the iframe, but of course, it just changes the page inside the iframe itself. I would like to know if there is a way that I can get any links inside the iframe to make the entire page change, not just the iframe.

If you're having trouble understanding what I mean, let me give you this example.

I have a web page. Call it page A. Page A contains an Iframe. inside the iframe is Page B. I want any links on Page B to change Page A, not Page B.

btw, the contents of the iframe belongs to me, so I can edit what's inside the iframe.

If all of this is impossible, then does anyone know of a good way to manage navigation bars without having to go through every single page it's on and edit the html?

TheJoshMan
10-02-2008, 03:35 AM
you can use:



<a href="somewhere.html" target="_parent">Click me from within IFRAME</a>


However, why not just use a PHP "include" for your menu to keep from having to use IFRAMES?

gutzs
10-02-2008, 02:37 PM
Thanks a lot for the code. And, I would use PHP but i've never used it before and not exactly sure what to do with it.