homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Trouble with iframes and Javascript

10+ Year Member

Msg#: 8059 posted 7:49 pm on Jun 10, 2004 (gmt 0)

I am attempting to do something that I hope is not impossible. I have an html calendar on my site. I want each day on the calendar to be clickable so that information about that day opens up in an iframe below the calendar. I had no problem with this until I added a javascript to the main document. This script is designed to detect the current date and display a certain html file in the iframe upon arrival at the calendar page. For some reason, since I have added the javascript, although the correct information pops up in the iframe automatically, whenever I try to click on a different date in the calendar to load new info in the iframe, it opens in a new window. I really need it to open in the iframe. In addition, I need this to work in Netscape 4.79, so ideally the content would also be loadable in a layer. I would also be open to substituting layers for the iframe altogether.

Does anyone know what I could be doing wrong?

Thanks in advance!




WebmasterWorld Senior Member 10+ Year Member

Msg#: 8059 posted 8:15 pm on Jun 10, 2004 (gmt 0)

Are you targetting the iframe correctly in the links?

You can embed the layer in the iframe, like this:

<a href="yourfile2.htm" target="content">your file 2</a>
<iframe src="yourfile.htm" name="content">
<ilayer src="yourfile.htm" name="content"></ilayer>

or something to that affect, I've never used ilayer tags so I'm not really up on them, but that's how it would work in theory.

If this is supposed to work in Netscape 4x browsers, then you can't use javascript's getElementById() to change the content, you have to change the location src of the iframe.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved