Connecting Tech Pros Worldwide Help | Site Map

onClick="history.back()

elia
Guest
 
Posts: n/a
#1: Jun 11 '07
Hello,

We change our server and before this code was ok:

<a href="#" onClick="history.back()">Retour</a>

...but on the new server, it doesn't work anymore?? We come back, see
the last page and return again to the page witn the code
"history.back".

I have to change this code or something on the server??

Thanks, pascal

David Dorward
Guest
 
Posts: n/a
#2: Jun 11 '07

re: onClick="history.back()


On Jun 11, 7:31 am, elia <jos...@pcl.chwrote:
Quote:
Hello,
>
We change our server and before this code was ok:
>
<a href="#" onClick="history.back()">Retour</a>
Quote:
..but on the new server, it doesn't work anymore??
There's no reason why a change in server should break code, but that
should be avoided for a number of reasons:

* It is a link to the top of the page. href="#" is not a sensible fall
back should JS fail
* It depends on JavaScript
* The user already has a back button, it is generally a bad idea to
waste space with a UI that duplicates a function built into the
browser but with a UI the user doesn't recognise.
* Links go forward. You have something that looks like a link, but
doesn't act like it.

Just remove it and let the user use their back button, or backspace
key, or Alt+Left Arrow, or Right Click and pick Back, or ...

--
David Dorward
http://dorward.me.uk/

ASM
Guest
 
Posts: n/a
#3: Jun 11 '07

re: onClick="history.back()


elia a écrit :
Quote:
Hello,
>
We change our server and before this code was ok:
>
<a href="#" onClick="history.back()">Retour</a>
Ça c'est du code écrit dans un fichier html, avec une action JavaScript
au clic sur le lien qui demande *coté client* que le brouteur remonte
dans son historique. Ça ne devrait pas à voir avec le serveur ?!

Une variante :

<a href="#" onclick="history.go(-1)">Retour</a>
Quote:
..but on the new server, it doesn't work anymore?? We come back, see
the last page and return again to the page witn the code
"history.back".
Curious ... ? !
May we see ?
Are these pages displayed in a popup ?
Does that arrise with any browser ?
Quote:
I have to change this code or something on the server??
Il n'y a certainement pas ce code sur le serveur !
Quote:
Thanks, pascal
Ask to a group speaking of server


--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Closed Thread