Anne van Kesteren wrote:
Hmm, actually, per HTML5 it seems that's impossible because the origin of bar.com and foo.bar.com are not the same and therefore you can't access any members of foo.bar.com from bar.com or vice versa. document.domain can change this I suppose
Exactly.
but doesn't it change the origin as well then for both domains
No. For example, as discussed before, document.domain does not affect same-origin XHR checks; those happen against the original domain for the document.
-Boris
