• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 590
  • Last Modified:

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.
0
netbest
Asked:
netbest
  • 5
  • 4
1 Solution
 
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
 
tecbuilderCommented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now