I want to call ASMX service from my another domain. So far I have the following code of sample:
e.preventDefault();
var CityName = {};
CityName.Name = $("input#name").val();
$.ajax({
data: '{name:' + JSON.stringify($("input#name").val()) + '}',
url: 'http://192.168.1.110/forgetit//webservice.asmx/CityTestExample',
contentType: 'application/json; charset=utf-8',
method: 'post',
dataType: 'json',
success:
function(data, textStatus, XMLHttpRequest) {
alert("data Saved");
}
});
});
basically from one domain i wants to insert data that is call asmx service from another domain how should i get this my web console give me this error
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header please give me any suggestion it will be very helpful for me thanks.