/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] history.back() going back 2 pages instead of 1 on IE

Hi all.

I’m in the midst of a site where the user would progress page-by-page through a series of options, but on certain pages there is a “Back” button which will allow him or her to go back to the previous page. To execute this I am using:

[CODE]<a href=”javascript:history.back();” onclick=”history.back();”><img src=”backbutton.gif” border=”0″ /></a>[/CODE]

which takes the user back one page on every browser EXCEPT good ol’ pain-in-the-ass IE where it skips one and takes them back 2 pages 😡 I’ve also tried history.go(-1); as well, but the same result on IE.

Am I missing something? Or does IE have a general problem with history.back() ?

Thanks in advance,
Michael

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@mataichiJun 18.2009 — Why does you have href and onclick = history.back?

I would think you would only need href and remove the onclick event.
Copy linkTweet thisAlerts:
@memersonauthorJun 18.2009 — Yep! That was what it was! Thanks! I don't know why I did that :o
×

Success!

Help @memerson spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...