Skip to content

Instantly share code, notes, and snippets.

@pnomolos
Created May 8, 2009 04:48
Show Gist options
  • Save pnomolos/108627 to your computer and use it in GitHub Desktop.
Save pnomolos/108627 to your computer and use it in GitHub Desktop.
<!-- The cheater way -->
<a href="javascript:window.history.go(-2);">Go back 2 history</a>
<!-- The more correct way -->
<span id="go-back">Go back</span>
<script type="text/javascript">
document.getElementById('go-back').onclick = function() {
window.history.go(-2);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment