The document.domain Property
document.domain property can be used to allow interaction with a subdomain. For example, if you want a document at www.domain.com to communicate with a document at forums.domain.com, the
The postMessage Method
HTML5's cross-document messaging uses a
postMessage method to enable documents from separate domains to communicate with each other while still providing protection from cross-site scripting attacks.
Cross-Origin Resource Sharing
W3C's Cross-Origin Resource Sharing (CORS) uses HTTP Origin request headers and Access-Control-Allow-Origin response headers to specify allowed domains to facilitate cross-domain Ajax requests.