Open Bug 326072 Opened 19 years ago Updated 2 years ago

onClick="history.back();" doesn't work right

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: gast00n, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

A link with <a href="#" onClick="history.back();"> first goes back, then goes 'forward' to the page with the back link.



Reproducible: Always

Steps to Reproduce:
1. Make a page "test.htm" with a link to test2.htm
2. Make a page "test2.htm" with this body : <a href="#" onClick="history.back();">Back</a>


Actual Results:  
Browse test.htm, click on the link to test2.htm 
When clicking on the 'Back' link, test.htm appears a very short time and test2.htm comes back.

Expected Results:  
Clicking the 'Back' link shows test.htm and stays on it.
This is a bfcache issue.
Attached file Prob Testcase
Example case of the problem zip file.
Assignee: nobody → events
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
I confirm this bug and also another one :
history.back() doesn't work if the page as an iframe and document loaded in the iframe.
Then you have to click twice on the button that launches the history.back() to make it work fine !!
This is because Bug #274399
try onClick="history.back();return false"
Assignee: events → nobody
QA Contact: ian → events
Component: Event Handling → User events and focus handling
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: