How can I detect if my page was "resurrected" with the back button?
you can check to see if the page was accessed via the browser history, like this
if (!!window.performance && window.performance.navigation.type === 2) {
// value 2 means "The page was accessed by navigating into the history"
console.log('Reloading');
window.location.reload(); // reload whole page
}
Detect if the user has used the back button
I'd have thought that using cookies is the easiest way to do this
Related Topics
Create a Newline for Every X Number of Characters
How to Send One Alert from My Node.Js to My JavaScript Client
Parsing Error: Unexpected Token, Expected ","
How to Escape an Ampersand in a JavaScript String So That the Page Will Validate Strict
React - Clearing an Input Value After Form Submit
Sum Numbers in HTML Inputs, JavaScript
Combining JavaScript and CSS into HTML File
Check If Two Div HTML Elements Intersect
Html - Clicking a Button to Obtain Table Cell Value
Want to Hide Menu by Clicking Outside the Menu Element
How to Put a Variable in an Src Attribute
Modifying a Query String Without Reloading the Page
Javascript Dashes in Phone Number