I am using JSONP in order to make a AJAX Cross domain call as following:
$(document).ready(function () {
$("#btnWCFREST").click(function () {
$.ajax({
type: "GET",
url: "http://localhost:1415/MyService.svc/rh/data?id=4&callback=mycallback",
processData: false,
dataType: 'jsonp',
jsonpCallback: 'mycallback',
jsonp: 'callback'
});
});
});
function mycallback(data) {
alert(data);
};
I am not getting any response. Could anybody help me in order to resolve the issue? What is wrong with the call?
I have changed the call as following still no luck:
$(document).ready(function () {
$("#btnWCFREST").click(function () {
var url = "http://localhost:1415/MyService.svc/rh/data?id=4";
$.getJSON(url + "?callback=?", null, function(data) {
alert(data);
});
});
});