Document.domain (Property)

A means of allowing web servers that trust one another to allow normally insecure access from one another's documents.


DOM level - 1
JavaScript - 1.1
JScript - 3.0
Internet Explorer - 4.0
Netscape - 3.0
Opera - 3.0
Property/method value type:String primitive
JavaScript syntax:-myDocument.domain

This is part of the Netscape security model that allows unsigned scripts to communicate with one another as long as they belong to the same domain.

Normally, documents may not always be able to communicate with one another because they come from different servers. This can be alleviated by specifying a domain that is shared by several servers.

The initial value of this property is the complete host name of the server that provided the document when it was loaded.

A script is able to set a domain value that is a suffix of the existing domain. So, can become but cannot become which allows you to serve documents from several hosts in the same domain but not access content served by other domains.

Once any two documents have the same domain setting, they can exchange property values with one another even though they may have originated on different hosts.


See also:Document object, JellyScript, Security policy

Property attributes:


insert figure 0052