As you probably know XmlHttpRequest only works if the request is made to the same web server from which the page was fetched ( Como você provavelmente sabe XmlHttpRequest só funciona se o pedido for feito para o mesmo servidor web a partir do qual a página foi trazida ( same origin mesma origem ). Here is a way to communicate across sub-domains using XmlHttpRequest without resorting to reverse proxying. Aqui está uma maneira de se comunicar em toda a sub-domínios usando XmlHttpRequest sem recorrer para inverter proxy.

Abe (@ fettig.net) found a solution using iframe and an exception to the "same origin" rule. Abe (@ fettig.net) encontraram uma solução usando iframe e uma excepção para a "mesma origem" regra. A script can set the value of document.domain to a suffix of the current domain. Um script pode definir o valor de document.domain a um sufixo do domínio actual. If it does so, the shorter domain is used for subsequent origin checks. Se o fizer, o domínio mais curto é usada para posterior controlo origem. Thus scripts running in either frame will now be allowed to talk to each other. Assim, executando scripts em frame quer agora serão autorizados a falar um com o outro.

This method has a limitation as you can only make XmlHttpRequest calls up to the point where you set document.domain. Este método tem uma limitação que você só pode fazer chamadas XmlHttpRequest até ao ponto em que você definir document.domain. Once you do that, you gain the ability to communicate with the parent frame, but you lose the ability to make future XmlHttpRequest calls. Depois de fazer isso, você ganha a habilidade de se comunicar com os pais frame, mas você perderá a capacidade de fazer chamadas XmlHttpRequest futuro.

Abe tried switching document.domain to make subsequent calls but that failed in Opera and Mozilla browsers. Abe tentou mudar a fazer document.domain posteriores, mas que falhou nos navegadores Mozilla eo Opera. So he first tries switching document.domain in his code which works for Internet Explorer. Assim, ele tenta primeira comutação document.domain em seu código que trabalha para o Internet Explorer. If that fails then he uses a bridge frame to overcome the restrictions - document.location.replace("test4-bridge.html"); Se isso falhar, então ele usa um frame ponte para superar as restrições - document.location.replace ( "test4-bridge.html");
This bridge frame hack has been tested only on Mozilla browsers. Esta ponte frame hack foi testado apenas com navegadores Mozilla. So in essence his solution works for Internet Explorer and Mozilla groups of browsers. Por isso, em sua essência solução funciona para o Internet Explorer e grupos de navegadores Mozilla.

Read about his adventure Leia sobre sua aventura here aqui .

I think such solutions, though ingenuous, are inherently fragile as they exploit a security loophole in browser implementation which is likely to be plugged in future. Penso que essas soluções, embora ingênuo, estão intrinsecamente frágil, uma vez que exploram uma falha de segurança no navegador execução, que é susceptível de ser plugado no futuro.