Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go back and reload page - one button

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.

like image 326
Delicja Avatar asked Dec 06 '22 14:12

Delicja


1 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>
like image 90
Yngvar Kristiansen Avatar answered Jan 03 '23 01:01

Yngvar Kristiansen