I would like to know if it is possible to check if a certain page has been refreshed after clicking browser reload button or F5 and create a specific function.
For example:
if(page has been refreshed) {
code
} else {
other code
}
I would like to know if it is possible to check if a certain page has been refreshed after clicking browser reload button or F5 and create a specific function.
For example:
if(page has been refreshed) {
code
} else {
other code
}
when a page is refreshed, the page and all js variables will be restored to its original state. You might be able to do it if you set a flag in the browser's cookies or localstorage, so when the user refresh the page, you can check if the flag was set.