Ajax or JavaScript sub domain request
Some time we could have a situation like this one: a site in a sub domain, called http://a.test.com another site in another sub domain, called http://b.test.com of course, a generic main site, called http://test.com A common problem between one or more sub domains, is the possibility to use, or call, scripts in the main domain, because of security restrictions. The simplest solution is to force, in the client side, the document.domain, specifying the common one, i.e. dcument.domain = "test.com"; In this way you can add, for example, an iframe, and read its content, or use parent window object from the iframe that points, for example, to http://test.com There are different reasons to do it, and one of them, is the ability to share a global, or common, space, between every sub domain, performing Ajax requests or whatever else we need. This object, saved in http://test.com, and loaded by every other sub domain, like "a" or "b", could solve in a really simple ...