Name

domain — NN 3 IE 4 DOM n/a

Synopsis

Read/Write

The hostname of the server that served up the document. If documents from different servers on the same domain must exchange content with each other, the domain properties of both documents must be set to the same domain to avoid security restrictions. Normally, if the hosts don’t match, JavaScript disallows access to the other document’s form data. This property allows, for example, a page from the www server to communicate with a page served up by a secure server.

Example

document.domain = "megaCorp.com"

Value

String of the domain name that two documents have in common (exclusive of the server name).

Default

None.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.