跨错误域

My problem is that I am with cross, domains and I am making an ajax request to the same domain, ie say Petition domain A, the same domain A, the problem is that throws me error No 'Access-Control-Allow -Origin '.

$.ajax({
    type: 'get',
    url: baseUrl + 'site/getfichas',
    success: function (result) {
        var ResultadoBus = resultadoBusFicha.find('ul');
        ResultadoBus.empty();
        var categoria;

        $.each(result, function (index, item) {}); 
    }
});

From what I understand, if I'm making a request of the same domain this error should not, appear, but appears in some of the teams that work and others do not.

Appreciate your prompt's feedback.

Thank you

As quick and dirty work around you could add into the PHP of your target:

header('Access-Control-Allow-Origin: *');

But a better solution would be to check what Protocol and which Host you've when trying to connect to get the data from your target and which Protocol and host your target is using.

You can fix after that your code or reconfigure your server, if necessary.