By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

(re)naming an iframe

P: n/a
I'm trying to use iframe to create a menu for a bunch of pages - only
I'd like the menu to change slightly (a highlight) depending on what
page it's being displayed in.

<iframe name="menu" src="menu.html">

I think I can use javascript to change the name attribute of the
iframe, and then have menu.html display that info.

so lets say bali.html loads the iframe with menu.html. I'd then like
bali.html to change the name attribute of the iframe to "bali", and
then have menu display something slightly different on that basis. The
last part I can do, but I can't find anything that tells me how to
change the name attribute of the iframe. Can anyone help with this?

Thanks
Michael
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Angelo wrote:
I'm trying to use iframe to create a menu for a bunch of pages - only
I'd like the menu to change slightly (a highlight) depending on what
page it's being displayed in.

<iframe name="menu" src="menu.html">

I think I can use javascript to change the name attribute of the
iframe, and then have menu.html display that info.

so lets say bali.html loads the iframe with menu.html. I'd then like
bali.html to change the name attribute of the iframe to "bali", and
then have menu display something slightly different on that basis. The
last part I can do, but I can't find anything that tells me how to
change the name attribute of the iframe. Can anyone help with this?


have bali.html set a variable in the menu.html:

loadedPage = 'bali.html';

or:

menuToUse = 'bali';

And then act on that variable instead of the IFrame's name attribute.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.