document.domain

JavaScript 1.1+, JScript 1.0+ Nav3+, IE 3+, Opera3+ Syntax

document.domain

Description

The domain property initially contains the hostname of the server from which the document was loaded. The document is allowed to change the value to the domain minus the prefix. For example, if a Web page originated from www.example.com, the document could change this to example.com. The reason this is allowed is so different pages that come from different servers within the same Web site can share properties. The restrictive quality of this property keeps unrelated documents from wrongfully seeing the data each document might have collected.

Example

No example is provided, because the document would have to originate from a server ...

Get Pure JavaScript 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.