Today I’ve encountered a very strange error while trying to get the contents of a PHP file on my server with $.get.
It happens only in Safari and Chrome on Mac OS X (Snow Leopard), on Windows it does work in all browsers properly.
The function is like:
function _fc() {
$.get("_x_fc.php", { xaction: 'login', xv1: $('#login').attr("value"), xv2: $('#pass').attr("value") }, function (data) {
if (data=='0') { letItGo=true; $('#loginform').submit(); }
else ...//Do some other checks
});
}
- It’s NOT a local server, it’s a web server with an existing domain
- I’m NOT trying to perform any cross-domain ajax. Both files are in the same directory.
I can’t find any solution for that.
Exact error:
XMLHttpRequest cannot load
http://www.asking1.com/_x_fc.php?xaction=login&xv1=something&xv2=something.
Origin http://asking1.com is not allowed by Access-Control-Allow-Origin.
I’ve done this this way:
You guys are the best. Thank you.