javascript:history.back() problem with Netscape Frames

I've experienced a problem when using the javascript:history.back() construct on a site employing Frames and viewed by a Netscape client.  It works fine with MSIE 4.0 but with Netscape, it appears to do something (no errors) but don't perform the back function.  

Is there anyone out here that can offer a suggestion for how to make this function work (or one like it) work for both major browser client software products?

I have tried the javascript:history.go(-1) construct and that didn't work either.  

For whatever reason, as I noted above, back() works 100% of the time with MSIE 4.0 and never with Netscape's browser (4.0n).

Thanks in advance for your assistance.
netbestAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
tecbuilderConnect With a Mentor Commented:
The problem is that you are using the history list of the parent and not of the frame and how the history list works with frames.  Instead of history.go(-1) use parent.mainframe.history.go(-1).  Also instead of history.go(1) use parent.mainframe.history.go(1).  Another option is to ue the history.back() or history.forward() functions.

Let me know how this works out for your.
0
 
rigansenCommented:
I don't work with IE, but you must know that the history array saves one entry for every frame that is loaded so if you load a page with frames and expect to go back using history.go(..), think that history.go(-1) will work?? well, you're wrong... you'll have to use maybe history.go(-2) or history.go(-3), depending on the number of frames you're working with!!

good luck on this one!!

rigansen.
0
 
netbestAuthor Commented:
Edited text of question
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
netbestAuthor Commented:
Ive tried as tecbuilder suggested without success.  The use of javascript:parent.mainframe.history.go(-1) causes an error (parent.mainframe.history is not an object).  I'm not versed on javascript but, is there a possibility that I have to set some other parameter?
0
 
tecbuilderCommented:
Did you substitute the word 'mainframe' with your frame's name?  If not do this.
0
 
netbestAuthor Commented:
Just so I don't go off into another wierd loop..  The need is to take the user back to whatever location they came from.  If it was from within the site, fine... if not, it needs to take them back to where ever then came from.  Will the parent.<framename> do this?
0
 
tecbuilderCommented:
Only if they went somewhere from within the frame.  Did you try using the history.back() and history.forward() functions?  These you would use the same way as you were using the history.go(-1) and history.go(1) functions respectively.
0
 
tecbuilderCommented:
Only if they went somewhere from within the frame.  Did you try using the history.back() and history.forward() functions?  These you would use the same way as you were using the history.go(-1) and history.go(1) functions respectively and may work better for what you want.
0
 
netbestAuthor Commented:
I've tried parent.history.back(), history.back(), parent.history.main.back() and the same optioins with go(-1).  When I use the parent.history.back() Netscape and MSIE both send me to the first page behind the site.. even if I've been navigating within the site.

The only thing that works like I want it to (MSIE ONLY)is the javascript.history.back().  It don't seem to care whether it is in a frame or not.  It just takes me back one space in common history.  Netscape thinks it did something (4.04 by the way) but it don't load the previous page.  This sure has become more complecated that I'd hoped it would.
0
 
tecbuilderCommented:
The information I've given you is all that I know and found.  The only other things left is document.history.back() or self.history.bac().  Otherwise, it may just be a bug within Netscape.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.