JavaScript 如何用js得到当前页面的url信息方法(JS获取当前网址信息) 作者admin,发布于 8 12 月, 2015。 设置或获取对象指定的文件名或路径。 alert(window.location.pathname) 设置或获取整个 URL 为字符串。