I am trying to run this script from localhost but it gets an error 405 (Method Not Allowed) .
Code
$(document).ready(function(){
$.ajax({
url:'http://some.url/',
type:'post',
//crossDomain: true,
data:'{id:"49"}',
contentType: "application/json; charset=utf-8",
dataType:'jsonp',
success: function(responseData, textStatus, jqXHR) {
alert('right');
var value = responseData.someKey;
console.log(value);
},
error:function() {
alert("Sorry, I can't get the feed");
}
});
});
I have tried with crossDomain:true
and $.support.cors = true
, but of no use.Any ideas?