I need to go back on previous page and refresh it. I use history.go(-1) but the form on the previous page is not reloaded.
Thanks for answers.
I need to go back on previous page and refresh it. I use history.go(-1) but the form on the previous page is not reloaded.
Thanks for answers.
As per 10th June 2014, I have tested latest Chrome 35, FireFox 29 and IE 11. Only Firefox didn't do a reload when I did location.history.back(). So I replaced location.history.back() with
location.href = document.referrer
So my back button now works like this:
<a href="#" onclick="location.href = document.referrer; return false;">Back</a>
If you reopen the page it should automatically refresh. You can probably get the url of the referring page via document.referrer
Hope that helps.
I think I invented a way of doing this. By adding a random parameter to url, we force browser to refresh...
var backLocation = document.referrer;
if (backLocation) {
if (backLocation.indexOf("?") > -1) {
backLocation += "&randomParam=" + new Date().getTime();
} else {
backLocation += "?randomParam=" + new Date().getTime();
}
window.location.assign(backLocation);
}
on the previous page use the following
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
in case of asp
in addition check this