<script>
タグはポリシーから除外されているため、タグを使用して異なるサブドメイン間にのみスクリプトを含めることができます。
http://www.example.com/dir/page.html
ソースとして使用する(ウィキペディアから):
Compared URL Outcome Reason
---------------------------------------------------------------------------------------------
http://www.example.com/dir/page.html Success Same protocol and host
http://www.example.com/dir2/other.html Success Same protocol and host
http://www.example.com:81/dir2/other.html Failure Same protocol and host but different port
https://www.example.com/dir2/other.html Failure Different protocol
http://en.example.com/dir2/other.html Failure Different host
http://example.com/dir2/other.html Failure Different host (exact match required)
http://v2.www.example.com/dir2/other.html Failure Different host (exact match required)
アップデート:
スクリプトを使用して、server2上のサービスと非同期で通信できますか?
はい、JSONPを使用できます。これは、タグのオープンポリシーを利用して<script>
、他のオリジンからJSONを取得します。
次のStackOverflowの投稿で説明されているように、リバースプロキシの使用を検討することもできます。