473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

(re)naming an iframe

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
1 1217
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Thies | last post by:
I'm (still) having trouble reading the contents of an IFRAME (IE5). I have this: var my_iframe = document.frames; What I would want to do at that point is get either the...
4
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I...
2
by: Templar | last post by:
Hi i'm bothering with such problem... I must dynamic create an Iframe, and then put som raw HTML into it. But I can't. When I create iframe, I can't access its properties. Here's the coe...
7
by: Vincent van Beveren | last post by:
Hi everyone I have a JavaScript app that creates an IFRAME through DOM (createElement('IFRAME')) However, that IFRAME does not have any content yet. ...
3
by: Alexandre Jaquet | last post by:
Hi I wanna know how can I reload an iframe does I've to move my iframe into another form an do a submit or may I can do it by another way rigth now I'm been doing : my form name is mainform...
5
by: Chris Kennedy | last post by:
I want to put an Iframe on a webform page. How do I get the Iframe's source file to change at the press of button control on a web form (containing the iframe). Preferabaly without javascript,...
8
by: Jason | last post by:
In my ASP.NET 1.1 solutions, I created several web projects and compiled them each into an assembly. The assembly names reflected the functionality of the feature (Membership.dll, Dues.dll, etc)....
7
by: Tom Cole | last post by:
IFrames have been used by years for people to accomplish many of the tasks the XMLHttpRequest does for them now...I unfortunately am late in the game and XMLHttpRequest was already out there by the...
9
by: BillCo | last post by:
I'm coming from a MS Access background and so I'm very used to and comfortable with the hungarian (Leszynski et al) naming conventions. However, I'm getting started into my first SQL Server...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.