Answers for "window.location.href breaks back button"

0

window.location.href breaks back button

// Fixes back button issue when using history.pushState();
window.onpopstate = e => {
    window.location = location.href;
};
Posted by: Guest on March-13-2021

Browse Popular Code Answers by Language