document.URL
概述
返回当前文档的 URL 地址
语法
string = document.URL
备注
该属性的值和
DOM Level 0 中的document.location.href
属性的值是相等的。然而 document.location.href
是可写的,document.URL
是只读的。
document.documentURI
也返回与该属性相同的值,不过它在非 HTML 文档中也可以使用。
返回当前文档的 URL 地址
string = document.URL
该属性的值和
DOM Level 0 中的document.location.href
属性的值是相等的。然而 document.location.href
是可写的,document.URL
是只读的。
document.documentURI
也返回与该属性相同的值,不过它在非 HTML 文档中也可以使用。