Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

javascript:history.back() problem with Netscape Frames

Posted on 1997-12-19
10
Medium Priority
?
563 Views
Last Modified: 2008-02-01
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
Comment
Question by:netbest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 2

Expert Comment

by:rigansen
ID: 1277034
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
 

Author Comment

by:netbest
ID: 1277035
Edited text of question
0
 
LVL 6

Accepted Solution

by:
tecbuilder earned 200 total points
ID: 1277036
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.

 

Author Comment

by:netbest
ID: 1277037
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
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277038
Did you substitute the word 'mainframe' with your frame's name?  If not do this.
0
 

Author Comment

by:netbest
ID: 1277039
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
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277040
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
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277041
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
 

Author Comment

by:netbest
ID: 1277042
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
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277043
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question