Forum Moderators: open

Message Too Old, No Replies

Iframe Refresh with Javascript

Why won't the frame refresh with this code?

         

t1mmy

2:45 pm on Jun 12, 2006 (gmt 0)

10+ Year Member



I have three framesets with the top frameset containing the main navigation buttons along with the iframe that I would like to refresh (this project has become a nightmare, I wouldn't have used frames, but...).

The iframe contains a html file (random.html) which includes a script that displays a random image. For the sake of time and simplicity, I want the radom.html file to refresh when the user clicks on any of the navigation to show a different image. However, this is proving more difficult than I expected.

The navigation snippet below contains a rollover image (I would have used CSS, but we're past that point right now). I tried placing the javascript to refresh the iframe within the href tag, however I have had unsuccessul results. The iframe name and id tags are both named 'boatFrame.'

Can anyone help me out? I believe the soltion is simple, however I am having a hard time finding articles

<a href="javascript:frames['boatFrame'].location.href=random.html" target="boat" onclick="return cngFrm('what/what_subnav.html', 'what/what.html')" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('What','','images/what_roll.gif',1)"><img src="images/what.gif" alt="What We Do" name="What" width="100" height="25" border="0" id="What" /></a>

t1mmy

9:25 pm on Jun 12, 2006 (gmt 0)

10+ Year Member



i figured out a solution. all i did was target my iframe through a bit of javascript that i'm using to target two seperate frames (for the subnav and content). definately not pretty, but it works.

now on to figure out how to fix the 15px vertical scrollbar issue. :(