I want to call a WebMethod in my application hosted on different server and url, but fails every time.
$.ajax({
url: 'http://xyz.com/ATAServices/ServicePage.asmx?CallWebServiceUsingJson',
type: "GET",
crossDomain: true,
async: false,
data: JSON.stringify({ UserName: $('#txtUserName').val(), UserPassword: $('#txtUserPasssword').val(), SiteName: '1' }),
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (data) {
},
error: function (ts) {
alert(ts.responseText)
}
});
Please help me to use Cross Domain webmethod