Closed Bug 325199 Opened 19 years ago Closed 17 years ago

the page simply refreshes when the script 'window.history.go(-1)' is used. This applies to the safe mode of firefox also.

Categories

(Firefox :: Bookmarks & History, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 157820

People

(Reporter: saumya, Unassigned)

Details

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 The cancel button used in the image upload page may be called from different pages. Thus, it's best to use the history function to navigate to the next page. Thus, the code : 'window.history.go(-1)' is used in the onclick event of the cancel button. But, when the cancel button is pressed, the current page simply refreshes. It doesn't navigate to the previous page in history. Also, there aren't any errors shown in javascript concole regarding this. Please advice. Reproducible: Always Steps to Reproduce: 1.include the code "onclick='window.history.go(-1);'" in the html of cancel button 2.Refresh the current page by pressing Ctrl+F5 3.Click cancel button. Actual Results: The current page simply refreshed. Expected Results: Expected to move to the previous page in history. This was tried out in FireFox safe mode and the same problem persists.
Does this happen in firefox 1.5?
The version in which this occurs is 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7'. Please advice if it has already been resolved.
I'd be glad to test with 1.5 if you can attach a testcase along with steps to reproduce and ACTUAL and EXPECTED behaviour.
Kindly provide me the link to the site where i can download Firefox 1.5
Thank you for the url. I have installed firefox 1.5 and the problem still persists though it is slightly different. Steps to follow: 1: create an html page called "first.htm" in localhost and include the following code: <a href="localhost/second.htm">Next</a> 2: create an html page called "second.htm" in localhost and include the following code: <a href="#" onclick="window.history.go(-1);">Back</a> *But I have used an image instead of the label 'Back' 3: Run the page "first.htm" in the browser and click the link 'Next'. 4: It will load the page "second.htm" 3: Click the link 'Back' Actual Result: on clicking 'Back' the browser loaded "first.htm" first and then returned to "second.htm" automatically Expected Result: The browser should load "first.htm" and remain there.
This is a duplicate. The problem is that you're not canceling the click event, so first go(-1) is executed and then second.htm# is loaded. If you cancel the event so that the latter doesn't happen, you'll be fine.
Whiteboard: DUPEME
Component: History → Bookmarks & History
QA Contact: history → bookmarks
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.