I Have Javascript Function and I Want to call it On each time user Refresh the Page from Browser Not On page load or Body Onload
Can any one tel me the how to call the folowing function on Only reload from Browser in JS or C#
document.onkeydown = function disableKeys() {
if( typeof event != 'undefined' ) {
if( (event.keyCode == 112) ||
(event.keyCode == 114) ||
(event.keyCode == 116) ) {
window.location.replace('Login.aspx');
return false;
}
}
};
I’m not sure if there is a direct way to do this, but you can do this:
It uses two diferent way of detecting refresh with JS
http://www.tedpavlic.com/post_detect_refresh_with_javascript.php