AJAX request error - I can not handle the return

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 it shows a json on the Chrome Network tab. But I can not manipulate using the variable data either in an alert or on my own return. Is there something wrong with the code?

Alert on the variable date

AbaNetwork

I think the error ta aq:

  

"Failed to load: Response to preflight request does not pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. '127.0.1.1' is therefore not allowed access . "

    
asked by anonymous 26.05.2018 / 16:42

0 answers