var url;
url = window.location.href; /* 获取完整URL */
alert(url); /* http://127.0.0.1:8020/Test/index.html#testname=test */
url = window.location.pathname; /* 获取文件路径(文件地址) */
alert(url
JS-使用JS方法获取当前页面的URL(网址信息)
最新推荐文章于 2023-09-06 11:56:21 发布