arseniyandru
arseniyandru

Reputation: 798

What value is used to set document.domain in browser?

What determines the value of document.domain property on page? It seems like it's not always equal to the root url domain.

Upvotes: 0

Views: 71

Answers (1)

Maarten ter Horst
Maarten ter Horst

Reputation: 2997

document.domain contains the complete domain (including subdomains) from which the page was downloaded. You can set it manually to a parent domain. E.g., you can set the domain of a document loaded from subdomain.example.com to example.com. <iframe>s may have a different domain than the domain in the url bar.

Upvotes: 1

Related Questions