-1

Have an app A hosted on port 80 with a hostname of mycompany.net

Have app B hosted on 8080 of the same server with hostname sub.mycompany.net.

Page 1 of app A opens Page 2 of app B. On Button Click of Page 2 of App B, I want to be able to update some text on Page1 of app A.

Have tried setting the document.domain of page 2 of app B to mycompany.net.

No luck. How do I overcome the 'Permission Denied' error. Help please....

  • 1
    How are you opening the 2 different pages? Are they in separate browser windows? – Matt Whipple Oct 12 '12 at 22:52
  • Why the down votes on this question, people? The OP is encountering a very common problem, and the question is well asked. – Jacob Oct 12 '12 at 23:42

1 Answers1

0

You also need to ensure that you set document.domain in Page 1, even if it's already set to mycompany.net (strange, I know). The reason why is that unless you write to document.domain, the port number is fixed to port 80 (even though it's not in the property value), denying Page 2 access. Writing to the property sets this hidden port restriction to null. See Same origin policy for JavaScript for more details.

Jacob
  • 77,566
  • 24
  • 149
  • 228