I'm getting this error while calling javascipt:
XMLHttpRequest cannot load https://sub.domain.com/actions/action1.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.domain.com' is therefore not allowed access.
- Javascript is placed here:
https://www.domain.com/page.php
- Javascript do job through:
https://sub.domain.com/actions/action1.php
(requested resource)
I have found the easiest way how to solve this problem (same-origin policy):
<script type="text/javascript">
document.domain = 'domain.com';
</script>
But this isn't solving my problem. I have also tried to add this piece of code to both pages, but still nothing.
Any simple suggestions how to solve it?