Location href 属性

定义和用法
href 属性是一个可读可写的字符串,可设置或返回当前显示的文档的完整 URL。
语法
location.href
浏览器支持
所有主要浏览器都支持 href 属性
实例
实例
返回完整的URL(当前页):
<script>
document.write(location.href);
</script>
document.write(location.href);
</script>
以上实例输出结果:
document.write(location.href);
尝试一下 »

更多建议: