Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Determine if page was refreshed or redirected from another page?

The question is pretty much in title.

Is there a way in Javascript to determine whether the page has been refreshed by user or loaded after redirecting from other website?

like image 523
francesca Avatar asked Nov 25 '25 09:11

francesca


1 Answers

performance.navigation.type will tell you if the page was reloaded, and some more info. Check out the docs here

like image 82
skav Avatar answered Nov 27 '25 22:11

skav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!