📜  javascript代码示例后刷新页面和运行功能

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

代码示例1
window.onload = function() {
    var reloading = sessionStorage.getItem("reloading");
    if (reloading) {
        sessionStorage.removeItem("reloading");
        myFunction();
    }
}

function reloadP() {
    sessionStorage.setItem("reloading", "true");
    document.location.reload();
}