Java command <a href="#" onClick="history.go(-1)"> does not work.

RESOLVED FIXED

Status

Tech Evangelism Graveyard
English Other
RESOLVED FIXED
10 years ago
3 years ago

People

(Reporter: Hanswerner Spring, Unassigned)

Tracking

Details

(URL)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.9b4) Gecko/2008030714 Firefox/3.0b4
Build Identifier: Firefox 3 beta 4

This line works perfectly on Internet Explorer
 <td><a href="#" onClick="history.go(-1)"><img src="../../pic_1001/A/A_adwxa_3E04_3D.gif" width="1001" height="834"></td>
but not on Firefox 3 beta 4 (see below)

Reproducible: Sometimes

Steps to Reproduce:
1.open http://www.fractalus.ch/man_3d/orders_e.html
2.click one of the thumbnails, big picture appears.
3.click on this pic should return to thumbnails, sometimes it does, usually not.

Actual Results:  
see above "Steps to reproduce"

Expected Results:  
see above "Steps to reproduce"

This http://www.fractalus.ch presents explanations in three languages. Since there no language dependend text appears on the huge pictures I searched for a command that acts as the backspace key or the green arrow to the left at top left of Firefox. I found the Java command <a href="#" onClick="history.go(-1)"> that works perfectly on the Internet Explorer by Microsoft, but not even on Firefox 3 Beta 4.
(Reporter)

Updated

10 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Comment 1

10 years ago
Why has this been marked FIXED?

Why was this filed in TE in the first place?

Reopening pending an explanation of the above two questions.
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---

Comment 2

10 years ago
It kind of works for me on Linux, but when I click on the large fractal image, I go back to the thumbnail page for a moment, but then go right back to the large fractal image. It is like the click event on the thumbnail is being fired again. 

Hanswerner, do you know how to find a regression range for this?
I believe this has always worked this way in Gecko.  The history.go() fires sync, the link load happens async (and later).  Anyone sane cancels the click event from the onclick handler when writing code like this.
(Reporter)

Comment 4

10 years ago
(In reply to comment #1)
I am sorry - but english is not my mothers laguage - therefore...

> Why has this been marked FIXED?
I hope, the bug sooner or later will be FIXED
 
> Why was this filed in TE in the first place?
I thought, TE would be best category for my problem. If I was wrong, excuse me please.
> 
> Reopening pending an explanation of the above two questions.
> 



(In reply to comment #2)
> It kind of works for me on Linux, but when I click on the large fractal image,
> I go back to the thumbnail page for a moment, but then go right back to the
> large fractal image. It is like the click event on the thumbnail is being fired
> again. 
> 
> Hanswerner, do you know how to find a regression range for this?
Sorry again, but I do not understand the question, what do you mean by "regression range"?
> 

(In reply to comment #3)
> I believe this has always worked this way in Gecko.  The history.go() fires
> sync, the link load happens async (and later).  Anyone sane cancels the click
> event from the onclick handler when writing code like this.
You mean, I should apply changes to my codes? Hopefully NOT!
> 

Comment 5

10 years ago
(In reply to comment #4)
> (In reply to comment #1)
> I am sorry - but english is not my mothers laguage - therefore...
> 

No problem. Your english is fine.

 
> > Why was this filed in TE in the first place?
> I thought, TE would be best category for my problem. If I was wrong, excuse me
> please.

No. It turns out that Tech Evangelism was pretty spot on.

> Sorry again, but I do not understand the question, what do you mean by
> "regression range"?

A regression is a change in behavior from previous builds or releases. A regression range is the range of dates where the behavior worked prior to a given date and doesn't work after a date. But in this case it doesn't apply accoring to Boris' comment.

> > 
> 
> (In reply to comment #3)
> > I believe this has always worked this way in Gecko.  The history.go() fires
> > sync, the link load happens async (and later).  Anyone sane cancels the click
> > event from the onclick handler when writing code like this.
> You mean, I should apply changes to my codes? Hopefully NOT!

easy fix. <a href="#" onClick="history.go(-1);return false">...</a>

the return false will cancel the default event handler and your content should work as you expect.


(Reporter)

Comment 6

10 years ago
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > I believe this has always worked this way in Gecko.  The history.go() fires
> > > sync, the link load happens async (and later).  Anyone sane cancels the click
> > > event from the onclick handler when writing code like this.
> > You mean, I should apply changes to my codes? Hopefully NOT!
> 
> easy fix. <a href="#" onClick="history.go(-1);return false">...</a>
> 
> the return false will cancel the default event handler and your content should
> work as you expect.
> 
If I look at the above lines then I fear to have to insert this > ; return false < on some 1'200 pages. If you tell me that you have more than 1'201 problems to fix the bug, then I'll do it. Otherwise I would be very, very happy.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago10 years ago
Resolution: --- → FIXED

Comment 7

10 years ago
What Operating system are you on? On Linux, I would do something like the following at a directory that contains your files.

find . -name '*.html' | xargs sed 's|"history.go(-1)"|"history.go(-1);return false;"|g' | less -S

which will edit each html file and pipe the results to the less command where you can review the changes for correctness. Note the above is all on one line.

To actually make the changes, add a -i argument to sed as in:

find . -name '*.html' | xargs sed -i 's|"history.go(-1)"|"history.go(-1);return false;"|g'

Of course, make a backup of your files before you do this!

If you are on Windows, you can use Cygwin <http://cygwin.com/> to get a Linux like environment.
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.