So I have a basic WCF service to be consumed by straight jQuery/HTML, no asp.net.
I can make GET calls to my test.svc/test via the browser and get my expected JSON result. {"d":["test1","test2","test3"]}
Now, I'm trying to consume it via jQuery 1.4.x
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
dataType: "json",
url: methodUrl,
data: {},
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: successCallback,
error: failedCallback
});
I'm grabbing the error info and dumping it to the console, this is my error. LOG: {"readyState":4,"status":0,"statusText":"error"} LOG: "error" LOG: {"message":"Access is denied. ","description":"Access is denied. ","number":-2147024891}
I've read that I need to use JSON-P and/or crossDomainScriptAccessEnabled or 30 other things.
So far I've not seen a consistent solution to this problem.
Any help would be appreciated.
Thanks! Jon