I created a project, it is an asp.net project and it has a Service1.asmx and ı hosted this project to remote server like a subdomain (myservice.test.com/Service1.asmx) and ı am calling this web service from an asp.net application with jquery ajax method. This application is on same remote server and ı hosted it like a subdomain (admin.test.com) when ı call admin.test.com/Default.aspx (this page uses web service abow) it is giving an error for this error ı looked with chrome console and it says: *(is not allowed by Access-Control-Allow-Origin.)*4444
GET_CAT_ALL: function (userId, callback, callback_err) {
try {
$.ajax({
type: "POST",
url: myservice.test.com/Service1.asmx + "/GET_CAT_ALL",
data: "{userId:" + userId + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
if (msg.d == "0" || msg.d.length == 0 || msg.d == null) {
if (typeof callback == 'function') {
callback(null);
}
}
else if (msg.d <= 0) {
if (typeof callback_err == 'function') {
callback_err(msg.d, msg, 'GET_CAT_ALL');
}
}
else {
var _data = eval("(" + msg.d + ")");
if (typeof callback_err == 'function' && _data[0] != null && typeof _data[0].ErrorCode != 'undefined') {
callback_err(_data, msg, 'GET_CAT_ALL');
}
else if (typeof callback == 'function') {
callback(_data);
}
}
},
error: function (msg) {
if (typeof callback_err == 'function') {
callback_err(-1, msg, 'GET_CAT_ALL');
}
}
});
}
catch (err) {
if (typeof callback_err == 'function') {
callback_err(-2, err, 'GET_CAT_ALL');
}
}
},