window.location.replace(currentUrl); and location code example Example: window replace url location.replace("url");