The domain name of the server that loaded this document:
let myDomain = document.domain;
Try it Yourself »
The domain
property returns the domain name of the server (the document was loaded from).
The domain
property returns null
if the document was created in memory.
document.domain
Type | Description |
String | The domain name of the server (the document was loaded from).null if the domain cannot be identified. |
document.domain
is a DOM Level 2 (2001) feature.
It is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 9-11 |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!