?
Solved

Problem with window.history.back()

Posted on 2004-11-03
5
Medium Priority
?
1,290 Views
Last Modified: 2010-05-18
I have used a "return" button with the Javascript code window.history.back() to return the user to the previous page, in the same way as if they pressed the back button.

I appears that for some users, this is apparently not working, and in fact backs them up several pages. I am wondering what the problem is, as on our test systems, this never occurs.

In particular, I am wondering if this problem could be browser specific, such as with Safari, as I have seen certain times when such things don't work right with this browser.
0
Comment
Question by:jasimon9
5 Comments
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 12489573
try   history.go(-1)
0
 
LVL 5

Expert Comment

by:cristy56
ID: 12489575
try window.history.back(-1) to control browser to go back for 1 page only.

Cristy
0
 
LVL 13

Accepted Solution

by:
davidlars99 earned 500 total points
ID: 12489581
you can try following

history.forward()
history.go(-1)
history.go(1)
history.back(1)
history.back(-1)
0
 

Author Comment

by:jasimon9
ID: 12549238
I am going out of town for a few days. Won't be able to evaluate the responses until new week.
0
 

Author Comment

by:jasimon9
ID: 12766525
I have tested the history.go(-1) version and it does not break our existing page behaviour. Unfortunately, we cannot reproduce the problem on our system, so we will not know whether it corrects the problem for "certain" users, unless over a long period of time the complaints do not continue.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

621 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