domain property (document)
Sets or returns the hostname of the server that served the current document.
Because of security restrictions, the contents of a document can be accessed from another document only if the two documents are located in the same domain. To ensure that security cannot be compromised, the domain property can only be set to the current or a higher-level domain. For example, the mail.example.com is a subdomain of the example.com domain, therefore the domain property can be changed from mail.example.com to example.com.
You can find the related objects in the Supported by objects section below.
This property is read/write.
String that specifies or retrieves the domain.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the domain property:
Did you find this example helpful?
Supported by objects:
User Contributed Comments