We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2785a88 commit bc61000Copy full SHA for bc61000
docs/dom/document.md
@@ -187,7 +187,7 @@ document.documentURI === document.URL
187
188
**(2)document.domain**
189
190
-`document.domain`属性返回当前文档的域名,不包含协议和接口。比如,网页的网址是`http://www.example.com:80/hello.html`,那么`domain`属性就等于`www.example.com`。如果无法获取域名,该属性返回`null`。
+`document.domain`属性返回当前文档的域名,不包含协议和端口。比如,网页的网址是`http://www.example.com:80/hello.html`,那么`document.domain`属性就等于`www.example.com`。如果无法获取域名,该属性返回`null`。
191
192
`document.domain`基本上是一个只读属性,只有一种情况除外。次级域名的网页,可以把`document.domain`设为对应的上级域名。比如,当前域名是`a.sub.example.com`,则`document.domain`属性可以设置为`sub.example.com`,也可以设为`example.com`。修改后,`document.domain`相同的两个网页,可以读取对方的资源,比如设置的 Cookie。
193
0 commit comments