0
I have the following AJAX request:
function getJson(link) {
var retorno;
$.ajax({
type: "POST",
url: link,
dataType: "json",
async: false,
success: function (data)
{
alert(data);
retorno = data;
}
});
return retorno;
}
When I run it shows a json in the Chrome Network tab. But nn I can manipulate using the date variable neither in an Alert nor in the return itself. There’s something wrong with the code?
Alert in the date variable
Aba Network
I think the error ta aq:
"Failed to load: Response to preflight request doesn’t pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin '127.0.1.1'; is therefore not allowed access."
believe it is in the background language the problem, otherwise in Alert would have appeared [Object Object]
– Wees Smith
What is the schedule of this return?
– novic
I can’t say, I’ll file a requisition with Trivago.
– Felipe Assunção
Check in the Network tab, in the devtools of Chrome or firefox, just press F12, see what the request is returning.
– codermarcos
In the Network tab appears the json that would be the return. But nn I can manipulate it through the date variable (defined in Success).
– Felipe Assunção
I think the error ta aq: "Failed to load: Response to preflight request doesn’t pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin '127.0.1.1'; is therefore not allowed access."
– Felipe Assunção