i am creating an MVC application.There was a neccessitity to make a variable in a session to null upon closing of the application (i.e. window/tab) but not upon refreshing t
You could just write it like this:
$(document.body).on("keydown", this, function (event) { if (event.keyCode == 116) { alert('F5 pressed!'); } });