How to go to URL within same domain in Javascript
In order to go to an URL relative to the current domain name in Javascript, use window.location.origin
like this:
example.js
window.location.href = window.location.origin + "/myurl"
Check out similar posts by category:
Javascript
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow