UK [dəˈmeɪn] US [doʊˈmeɪn]

n. Scope, domain; territory, territory; jurisdiction; [count] Domain name

Plural: domains

javascript domain attribute syntax

Function: Return the server domain name for downloading the current document.

Syntax: document.domain

Description: This attribute is a read-only string that contains the web server that loads the current document hostname.

Note: The domain attribute can solve the attribute sharing problem of different documents caused by the same-origin security policy.

javascript domain attribute example

<html>
<body>

本文档的域名是:
<script type="text/javascript">
document.write(document.domain)
</script>

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance