HBCMS更多的中文手册参考:

domain参数属性

DHTML文档教程

Sets or retrieves the security domain of the document.

dhtml语法

document.domain [ = sDomain ]

DHTML可能的值

sDomainString that specifies or receives the domain suffix.

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.

remarks

the property initially returns the host name of the server from which the page is served. the property can be assigned the domain suffix to allow sharing of pages across frames. for example, a page in one frame from home.microsoft.com and a page from www.microsoft.com initially would not be able to communicate with each other. however, by setting the domain property of both pages to the suffix "microsoft.com", you ensure that both pages are considered secure and access is available between the pages.

when you set the domain property, use the domain name determined by the server rather than by the client browser.

all the pages on different hosts must have the domain property explicitly set to the same value to communicate successfully with each other. for example, the value of the domain property of a page on the host microsoft.com would be "microsoft.com" by default. it might seem logical that if you set the domain property of a page on another host named msdn.microsoft.com to "microsoft.com," that the two pages could communicate with each other. however, this is not the case unless you have also explicitly set the domain property of the page on microsoft.com to "microsoft.com".

furthermore, this property cannot be used to allow cross-frame communication among frames with different domain suffixes. for example, a page in one frame from www.microsoft.com and a page in another frame from www.msn.com would not be able to communicate with each other even if the domain property of both pages was set to the suffix "microsoft.com".

security note security alert  using this property incorrectly can compromise the security of your web site. set the domain property only if you must allow cross-domain scripting. use a value determined on the server. setting this property to a value determined on the client (like through the location object) could expose your site to attack from another site through domain name system (dns) manipulation. for more information, see security considerations: dynamic html.

for more information on domain security, see about cross-frame scripting and security.

是否符合公共标准

This property is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

document