FIX: history.back() not working in Google Chrome, Safari and Webkit

07/15/2010
0

The standard history.back() does not work in Chrome and probably Safari and other Webkit browsers.

It took me a while to figure this out.

So this is how you make it work across all browsers:

Instead of:

<a href="javascript:history.back();">back</a>

Just use:

<a href="javascript:history.go(-1);">back</a>

If you've read this far you might as well follow me on Twitter here.


Comments