You can do a relative redirect:
window.location.href="https://stackoverflow.com/questions/1655065/"; //one level up
or
window.location.href="https://stackoverflow.com/path"; //relative to domain
More Related Contents:
- Change URL and redirect using jQuery
- How To Display Images Preview and Title When I Paste in Another Site Like Facebook, Whatsapp, etc
- How to pass parameter in url? pl. explain with example?
- How can I get query string values in JavaScript?
- How to manage a redirect request after a jQuery Ajax call
- Get escaped URL parameter
- Is there any way to specify a suggested filename when using data: URI?
- How do I redirect with JavaScript? [duplicate]
- Get protocol, domain, and port from URL
- Get the values from the “GET” parameters (JavaScript) [duplicate]
- How can I get the destination URL for the onbeforeunload event?
- How to get the anchor from the URL using jQuery?
- Using the GET parameter of a URL in JavaScript [duplicate]
- How to create query parameters in Javascript?
- How to check if the URL contains a given string?
- Get query string parameters url values with jQuery / Javascript (querystring)
- Page redirect with successful Ajax request
- Go to local URL with Javascript
- Sending user to their browser’s Home Page using Javascript
- Regular Expression – Extract subdomain & domain
- Angular url plus sign converting to space
- Usage of Hash(#) in URL
- How to change the URL displayed in the browser without leaving the page
- Relative URLs in AJAX requests
- How to redirect the user to another page after login using JavaScript Fetch API?
- How do I URl encode something in Node.js?
- REGEX: Capture Filename from URL without file extension
- Extract parameter value from url using regular expressions
- Checking a Url in Jquery/Javascript
- How to get base domain from the URL in JavaScript