I have the following code.
WCF REST method
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "Account")]
[OperationContract]
string GetUniqueLoginId();
Client Side Call
$.ajax({
type: "GET",
url: serviceURL + 'Account',
contentType: 'application/json; charset=utf-8',
dataType: "json",
success: app.onGetUniqueId,
error: app.onAjaxError
});
When I use IE (11), it works perfectly by returning a unique id. But when I use chrome, it gives me the following error.
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:5553' is therefore not allowed access.
How to resolve the issue? Any help would be appreciated.