JavaScriptโs locationย object Photo by Javier Allegue Barros onย Unsplash We can use the window.location property to access the URL of the current page and modify it. let location = window.location; For redirecting the page we can use: location.href = “new url”; // or we can use location.assign(“new url”); For redirecting without storing in history: location.replace(“new url”); …
Continue reading “Redirect, Refresh, and Access the URL of the Current Page in JavaScript”