window.onbeforeunload = function (e) {
var e = e || window.event;
var msg = "The browser back button should not be pressed "
// For IE and Fire[![enter image description here][1]][1]fox
if (e) {
e.returnValue = msg;
}
// For Safari / chrome
return msg;
};