Heh,
I'm using jQuery AJAX Call to pull data from a self hosted webservice (same domain), but it always return 0, which indicates a cross domain problem. But this shouldn't be a problem.
Any suggestions how to fix this? Thanks!
Website running my Script
http://www.mysite.com/facebook/el_login
My AJAX Call:
var data = 'username=' + username.val() + '&password=' + password.val()
$.ajax({
url: "http://www.mysite.com/api/v01/account/exists.json",
type: "GET",
data: data,
cache: false,
complete: function(transport) {
if(transport.status == 200) {
alert('Success');
} else {
alert('Failed ' + transport.status );
}
}
});
})
Firebug Request Headers:
Request Headersview source
Host www.mysite.com
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Proxy-Connection keep-alive
Content-Type application/x-www-form-urlencoded
X-Requested-With XMLHttpRequest
Referer http://www.mysite.com/facebook/el_login
Cookie sessionid=xxx
Edit:
Okay, it seems that AJAX Calls on static sites (same server) are working. My Webservice Backend is based on Django, Apache2 and mod_wsgi .. maybe there's a reason why this fails.