I make a GET request using Postman extension and obtain a response, but if I make the same request using jQuery I receive a typical error:
XMLHttpRequest cannot load http://www.rfen.es/publicacion/ranking/resultsBySwimmer.asp?l=020039535&t=&p=0&e=50L-I. No 'Access-Control-Allow-Origin' header is present on the requested resource.
Why does this happen?
My javascript code is simple:
function getTiempo (dni, piscina, prueba) {
$.ajax({
async: false,
type: "GET",
url: "http://www.rfen.es/publicacion/ranking/resultsBySwimmer.asp?l="+dni+"&t=&p="+piscina+"&e="+prueba
})
.done(function (data) {
console.log(data);
return data;
});
}
The Postman extension is not on the same domain either, why does it get a response?