📅  最后修改于: 2022-03-11 15:01:22.911000             🧑  作者: Mango
// fix disabled buttons via JS not enabling on page reload /
// back navigation.
window.addEventListener('pageshow', PageShowHandler, false);
window.addEventListener('unload', UnloadHandler, false);
function PageShowHandler() {
window.addEventListener('unload', UnloadHandler, false);
}
function UnloadHandler() {
//enable button here
window.removeEventListener('unload', UnloadHandler, false);
}