As you probably know XmlHttpRequest only works if the request is made to the same web server from which the page was fetched ( Come probabilmente sapete XmlHttpRequest funziona solo se la richiesta è fatta allo stesso web server da cui la pagina è stata recuperata ( same origin stessa origine ). Here is a way to communicate across sub-domains using XmlHttpRequest without resorting to reverse proxying. Qui è un modo per comunicare in tutta sub-domini utilizzando XmlHttpRequest senza ricorrere per invertire proxying.

Abe (@ fettig.net) found a solution using iframe and an exception to the "same origin" rule. Abe (@ fettig.net) trovato una soluzione utilizzando iframe e un'eccezione alla "stessa origine" regola. A script can set the value of document.domain to a suffix of the current domain. Uno script può impostare il valore di document.domain di un suffisso del dominio corrente. If it does so, the shorter domain is used for subsequent origin checks. Se lo fa, il più breve dominio viene utilizzato per i successivi controlli di origine. Thus scripts running in either frame will now be allowed to talk to each other. Quindi gli script in esecuzione in una cornice sarà ora consentito di parlare l'uno con l'altro.

This method has a limitation as you can only make XmlHttpRequest calls up to the point where you set document.domain. Questo metodo ha un limite, come si può fare solo XmlHttpRequest chiamate fino al punto in cui si imposta 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. Una volta che fare, lei avrà la capacità di comunicare con la casa madre cornice, ma si perde la capacità di fare futuro XmlHttpRequest chiamate.

Abe tried switching document.domain to make subsequent calls but that failed in Opera and Mozilla browsers. Abe ha cercato di passare a fare document.domain successivi bandi, ma che non in Opera e Mozilla browser. So he first tries switching document.domain in his code which works for Internet Explorer. Così egli cerca prima di passare document.domain nel suo codice che funziona per Internet Explorer. If that fails then he uses a bridge frame to overcome the restrictions - document.location.replace("test4-bridge.html"); Se non che poi utilizza un telaio ponte per superare le restrizioni - document.location.replace ( "test4-bridge.html");
This bridge frame hack has been tested only on Mozilla browsers. Questo ponte cornice hack è stato testato solo su browser Mozilla. So in essence his solution works for Internet Explorer and Mozilla groups of browsers. Quindi, in sostanza, la sua soluzione funziona per Internet Explorer e Mozilla gruppi di browser.

Read about his adventure Leggere la sua avventura here qui .

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. Credo che tali soluzioni, anche se ingenua, sono intrinsecamente fragili come sfruttare una lacuna nella sicurezza del browser in esecuzione che possa essere collegato in futuro.