How to get current URL using javascript
This question already has an answer here:
这是正确的答案:
window.location.host + window.location.pathname;
You want this:
var location = window.location.host + window.location.pathname;
see the docs: https://developer.mozilla.org/en-US/docs/Web/API/Location
链接地址: http://www.djcxy.com/p/22538.html上一篇: 在javascript函数中使用当前网址
下一篇: 如何使用JavaScript获取当前网址