返回当前 URL

5年以前  |  阅读数:360 次  |  编程语言:JavaScript 

返回当前 URL。

使用window.location.href获取当前 URL。

const currentURL = () => window.location.href;
// currentUrl() -> 'https://google.com'

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8