📜  Firefox 按钮未启用 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:22.911000             🧑  作者: Mango

代码示例1
// 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);
    }