I have the following code in an MVC view that I\'m using to test window.history.back()
$('#cancelButton').click(function(e){ e.preventDefault(); /* ... code ... */ });
The browser is probably interpreting the button as a submit button and submitting the form, thus causing a page refresh. Adding type="button" will prevent that.
type="button"
<button type="button">Cancel</button>