Jump to content

iFrame menu


Chromana

Recommended Posts

How do I make an iFrame in a normal HTML document have a link that, when clicked, changes the document that it is in? The main document is not an iframe.For example:

<body><iframe src="menu.html"></iframe>CONTENT</body>

So a link on the menu iframe changes the main document. I think it has to do with the target and name atributes but I don't know how to do it. Thanks for any help.

Link to comment
Share on other sites

Put this code in the ifame to change the url of the page that opened it:

<input type="button" value="New Page" onclick="window.opener.location.href='http://www.google.com'" />

Link to comment
Share on other sites

**reconsiders post**Your iframe is embedded within the body of the document, so if you change it's source the iframe wont exist anymore. I don't think it's possible to change the page but keep the iframe. :) Target="_top" = that would change the whole page

Link to comment
Share on other sites

THANK YOU THANK YOU THANK YOU (ok that was a bit noobish :) )That was exactly what I needed. You see, the iframe is the menu so it will be on every page anyway, so it would exist.Thanks again, you just saved the whole layout of my site!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...