I'm having a page (=parent) that contains an iview (=child) with different domains and I want to communicate between the both of them using JavaScript. I can already do this by manually setting the document.domain of the child (a.foo.bar) and the document.domain of its parent (b.foo.bar), so that they have the same domain afterwards (foo.bar) = domain-relaxation. This works great. Actually I can't "do" this, but it is already done by the default implementation of the child. Afterwards I can manipulate the childs content via JavaScript that is placed in the parents body, for example. I only have one problem: The parent doesn't know, if the child's document.domain has already been set to match the parents document.domain. I am not able to change the JavaScript of the child to send an event as soon as its domain has been "relaxed" (=changed from a.foo.bar to foo.bar).
My question is: Is there a way for the parent to check, if the domain of the child equals its own domain using JavaScript/jQuery? If that's not possible: Is there a way to try, whether the parent has permission to access the childs document, without provoking a "permission denied" error, if the domains don't match?
Thanks for your help in advance.
Regards, René