I am doing a cross domain AJAX call with dataType as jsonp. I have set the Jsoncallback querystring parameter in the URL. However, the callback function is not getting called at all and instead the page gets redirected to itself.
The AJAX call is basically hitting a dot CMS service which returns below response when I tested it in browser directly:
myfunction({'state':'MEL', 'plan':'true' })
Here, "myfunction" is the string which I pass as the value of Jsoncallback parameter in URL
Here is my AJAX call
$.ajax({
url:"http://website.hostname.com/validatepostcode.dot?postcode="+encodeURIComponent(thepostcode)+ "&Jsoncallback=parseResponse",
dataType: "jsonp",
async: false,
crossDomain:true
});
function parseResponse(data)
{
alert(data);
}
Am I missing any parameter in AJAX call? Or there may be something wrong at service side?