自强学堂
自强学堂:学习、分享、让你更强!
JavaScript 参考手册HTMLCSSJAVASCRIPTJQUERYSQLPHPBOOTSTRAPANGULARXML
 

HTML DOM domain 属性

Document 对象参考手册 Document 对象

定义和用法

domain 属性可返回下载当前文档的服务器域:

语法

document.domain


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持 domain 属性


实例

实例

返回下载当前文档的服务器域名:

<html>
<body>

The domain name for the server that loaded this document:
<script>
document.write(document.domain);
</script>

</body>
</html>

尝试一下 »


Document 对象参考手册 Document 对象