JS 获取当前页面url,及锚点

console.log(document.location);

打印出对象可以看到详细信息

原文地址:https://www.cnblogs.com/lxdd/p/4317320.html