JavaScript Same Origin Policy - How does it apply to different subdomains

Posted by DaveDev on Stack Overflow See other posts from Stack Overflow or by DaveDev
Published on 2010-03-30T08:33:29Z Indexed on 2010/04/29 1:07 UTC
Read the original article Hit count: 517

How does the Same Origin Policy apply to the following two domains?

http://server1.MyDomain.com

http://server2.MyDomain.com

Can I run JS on a page hosted on server1, if the content is retreived from server2?

edit according to Daniel's answer below, I can include scripts between different subdomains using the <script> tag, but what about asynchronous requests? What if I download a script from server2 onto the page hosted on server1. Can I use the script to communicate asynchronously with a service on server2?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about same-origin-policy