HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

domain

Description

The domain of Document for JS returns the current domain used for security checks.

Can be set to a value that removes subdomains, to change the origin's domain to allow pages on other subdomains of the same domain (if they do the same thing) to access each other. This enables pages on different hosts of a domain to synchronously access each other's DOMs.

In sandboxed iframes, Documents with opaque origins, and Documents without a browsing context, the setter will throw a "SecurityError" exception. In cases where crossOriginIsolated or originAgentCluster return true, the setter will do nothing.

Syntax

document.domain [ = domain ]

Examples

1 · get

2 · set