Doing ajax using this is fine :
$.post("http://localhost:3000/scrape",
{
data: json
},
function(data, status){
});
but this is not?
$.ajax({
type: 'POST',
url: 'http://localhost:3000/scrape',
data: json,
contentType: "application/json",
success: function(data,status){
},
async:false
});
With $.ajax I got the error of XMLHttpRequest cannot load http://localhost:3000/scrape. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I thought both of them are the same? What's the problem here?