Same-origin policy workaround using document.domain in Javascript
问题 I am running into same-origin policy issues in Javascript. I've read about a workaround for this using the document.domain variable, but I cannot get the workaround to work. The workaround is that you are supposed to be able to set document.domain to 'example.com' so that if you run code from foo.example.com it can load data via XHR from bar.example.com . Details on the workaround are here: https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript My example code -- which doesn't