Forum Moderators: open

Message Too Old, No Replies

I'm adding a back button with js but doesn't behave well :(

         

Paulr

6:31 am on Apr 21, 2011 (gmt 0)

10+ Year Member



Hi. I have added a back button to a few pages on my site using js. It works well in internet explorer but not firefox or chrome. I'm aware that these browsers have issues with js. Is there any alternative to my problem? Button code is

history.back ()

robzilla

9:53 am on Apr 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



history.back() works fine in my browser (Chrome). Make sure you don't have any spaces between history.back and (). Something like this ought to work:
<a href="javascript:history.back()">previous page</a>

Alternatively, you could try:
<a href="javascript:history.go(-1)">previous page</a>

Paulr

10:16 am on Apr 21, 2011 (gmt 0)

10+ Year Member



Thanks a lot :) I appreciate the help. I will try that out then!

Paulr

11:44 am on Apr 21, 2011 (gmt 0)

10+ Year Member



Just to let you know, I changed the script a little after what you said and the whole problem is fixed :) Thanks so much!