change current window location javascript code example Example: window replace url location.replace("url");