js获取当前页面路径
-
js如何获取域名后的路径,js获取域名路径
在JavaScript中获取域名后的路径或参数,最稳健且通用的方案是利用window.location对象的属性组合,如window.location.pathname获取路径,window.location.search获取查询字符串,而window.location.hostname则专门用于获取纯净域名……
在JavaScript中获取域名后的路径或参数,最稳健且通用的方案是利用window.location对象的属性组合,如window.location.pathname获取路径,window.location.search获取查询字符串,而window.location.hostname则专门用于获取纯净域名……