I have two applications:
- AppA in localhost:1834
- AppB in localhost:3597
An html page of AppB call a method of AppA with the following code:
jQuery.support.cors = true;
$.ajax({
url: 'http://localhost:1834/Home/SomeAction',
type: "GET",
dataType: "html"
}).done(...).error(...);
AppA return an html fragment.
The code works fine with IE9 (also with type=POST, data=somejson, contenttype=”application/json”), but it doesn’t either with FF12 or with Chrome19 (Status=0, StatusText=”error”)
Is it related to cross-site scripting?
ps:
- The call to AppA works and AppA send a response with 200 status code.
- jquery 1.7.2.
Thanks.
You’re right, it is related to Same Origin Policy. Your request have to be on the same domain and the same port.
http://en.wikipedia.org/wiki/Same_origin_policy