I have a subdomain website (mobile) that is trying to call a aspx page on my main domain website. There are no local files involved here (Domain to Domain). I am using jquery mobile and trying to make a ajax call. By looking around the web I know there will be a slim chance that someone will A.Understands my problem and B. Can answer it.
Once again. Making ajax call from jquery mobile site to domain site, getting error
Origin is not allowed by Access-Control-Allow-Origin.
I added this and it did not work
$(document).bind("mobileinit", function () {
$.mobile.allowCrossDomainPages = true;
$.support.cors = true;
})
Your server needs to send this HTTP header:
Using PHP (on the server) you would use this code:
or to allow requests from any client domain using PHP:
You can configure Apache to send this header for you in a configuration file:
http://harthur.wordpress.com/2009/10/15/configure-apache-to-accept-cross-site-xmlhttprequests-on-ubuntu/