如何在 Javascript 中转到同一域名内的 URL
为了在 Javascript 中转到相对于当前域名的 URL,使用 window.location.origin 像这样:
goto_relative_url.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