I'm using
Code HTML4Strict:<a onclick="history.go(-1);return false;" href="test.php">« Back</a>
In FF works ok but in Opera it needs 2 clicks to work properly. Does anyone knows a fix for this?
| SitePoint Sponsor |
I'm using
Code HTML4Strict:<a onclick="history.go(-1);return false;" href="test.php">« Back</a>
In FF works ok but in Opera it needs 2 clicks to work properly. Does anyone knows a fix for this?

It might have something to do with Opera's way of going back super fast.
Ultimately you could do something like this:
HTML Code:<a href="lastpage.php" id="back">Back</a>A bit hacky but it might be the only thing to do.Code Javascript:document.getElementById('back').onclick = function(e) { if (!e) window.event.returnValue = false; else e.preventDefault(); history.go(-1); window.setTimeout(function() { history.go(-1); }, 200); }


That code should work. Is there a frame on the page?
Thanks Raffles, it works now.
@QMonnkey
There are no frames.
Bookmarks