📜  如何使用 Javascript 或 React 获取当前 URL - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:29.598000             🧑  作者: Mango

代码示例1
const currentURL = window.location.href // returns the absolute URL of a page

const pathname = window.location.pathname //returns the current url minus the domain name