I have a domain like below.
I have two sub-domains within that as below.
I want to make a jQuery ajax call from foo.jayshit.info to bar.jayshit.info to get some html or to update some data back to server.
I know due to same origin policy its not that easy. and i do not want to use JSONP as well. because i want my ajax call to have async: false as below.
$.ajax({
type: "POST",
cache: false,
url: tURL,
data: tData,
async: false
});
Please let me know if anyone came across some workaround for this.
Thanks in advance.
Regards,
Since you are in control of the other sub-domain, you can send this header from bar.jayshit.info:
Modern browsers respect these headers and allow you to make the request. For IE8 you need to use
XDomainRequestwhich is not supported by jQuery.