I created a WCF data service in a new asp.net web application and I want to call this web service from another web application using jquery, but it always returns null.
My jquery query is as follows:
$.ajax({ type: "GET", url: "http://localhost:2916/PennyBridge.svc/Member", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { }, error: function (xhr) { alert(xhr.responseText); } });
Note that "http: // localhost: 2916 / PennyBridge.svc / Member" works in the browser, but since the jquery call comes from localhost: 3410, I assume this is a cross-domain problem.
I read that I have to use jsonp for this, but it's hard for me to understand it.
What do i need to use jsonp? Do I need to configure my WCF data service?
source share