Tuesday, May 11, 2010

JavaScript:history.go(-1) not working in Firefox

 

If you want to go to the last page or referer application history.go(-1) works for IE but it does not work in FireFox.

<a href="javascript:void(0);" onClick="JavaScript:history.go(-1);">Back</a>

The fix is to use history.back(); return false; as shows below:-

<a href="javascript:void(0);" onclick="history.back(); return false;">Back</a>

Reference: https://developer.mozilla.org/En/DOM/Window.history

1 comment:

Thank you for your feedback