Frames and Javascript and the Refresh Button Don't Mix!

liunx

Guest
K, here we go...<br />
<br />
I have a web site(just my personal page) that I'm working on. The page is divided into two frames, one on top for the navigation bar and header picture, and the other frame to hold all the content.<br />
<br />
Anyway, I have some fun little image swapping done with javascript - the active "tab" in the navigation bar is an image used to represent that it's active, and when you click on a different tab, the first active tab picture is switched to the inactive picture, and the new active tab gets its picture switched from inactive to active. Following so far? K...<br />
<br />
When you have clicked on any page except the default(home) page, and then hit the refresh button on your browser, the info page in the bottom frame is left alone, but the navigation bar gets reset to its original state- thus, your projects page is displayed(or whatever page it is), but your nav bar is telling you that it's the home page. Yuck.<br />
<br />
Is there a way to prevent one frame from refreshing, or to refresh and then quickly display the correct nav bar setting? I can post code here or ftp my site up to my web hosting (I haven't put it up on the net yet, since it's broken), if that would be helpful.<br />
<br />
Thanks,<br />
Torus<!--content-->as far as I know there is no way to stop the refresh from happening. the user has every right to refresh the page, it is your job to make it so it doesn't look bad. hence don't use frames. :)<!--content-->hey ,<br />
ofcourse you can post your code over here. infact it is easier for others to understand the problem better, if they can see the code ...<!--content-->K, I uploaded my site to my crappy free web hosting, so at least it's up and you can look at it now, although it's FAR from any sort of finished form.<br />
<br />
Mike.home (<!-- m --><a class="postlink" href="http://www.ebert.netfirms.com">http://www.ebert.netfirms.com</a><!-- m -->)<br />
<br />
Anyway, the code that I'm having trouble with is located in the top frame - I figure it would be more convenient to just "view source" from there instead of posting the whole thing here.<br />
<br />
Anyway, I don't really want to prevent a refresh, I would just like to know if there's anyway to make sure the nav bar accurately represents what's shown in the lower frame.<br />
<br />
Scoutt - what would you recommend instead of using frames? If you have a navbar that you have to insert in every single web page, what do you do if you want to change it? For big sites, you'd be changing hundreds of pages. Ewwwww.<br />
<br />
Torus<!--content-->then you include it in the each file with a javascript include and you only change 1 file. you also have SSI (serverside Includes) but those have to be supported on the site and the page has to have an extension of .shtml<br />
<br />
few ways to do it and they are all very easy to do.<br />
<br />
I will take a look at the code now.<!--content-->Ok, that including a file stuff is very intriguing... Is it only Javascript that you can include, or could you, say, include the table layout and image tags for the whole navbar as well?<br />
<br />
Scary as it is, at both of my jobs I ended up being the webmaster because I am the best option they've got. I actually read one of those huge, 800+ page guides to HTML, so I know HTML tags and properties pretty well, and I know layout and design pretty darn good, but the really cool stuff wasn't addressed in that book (obviously, since it was for beginners...). Anyway, the point of all this is that I have to do some major site revision soon, especially involving site navigation, and so your help will be for much more than just a goofy personal site!<br />
<br />
-Torus<!--content-->well, sorry it took so long, been a long day already.<br />
<br />
from what I see that you need to really update that javascript as it is old, well not reall yold but weak. I am no tbig on javascript but that is my opinion.<br />
<br />
you might want to ask other people but I say scrap that javascript for a better version and redo your site so you don't have to use frames.<!--content-->
 
Back
Top