I want to disable back button in the navigator with javascript, i used:
document.addEventListener("popstate", urlBackButton, false);
function urlBackButton() {
isBackButton = true;
var url = $("#cannotUseBack").val();
if (url == "/mypage") {
window.history.go(1);
return false;
} else {
return true;
}
}
It doesn't work.
Any help is appreciated. Thanks!