How to enable url in different domain, I get CORS policy error when calling ajax query in Sharepoint 2013


How to enable url in different domain, I get CORS policy error when calling ajax query in Sharepoint 2013

I did my ajax call properly, also i saw the results Internet Explorer. It works fine. But Edge, Chrome are blocking the url. I want to enable this url. Also we have two servers in the system. So what do you offer to me?

    $.ajax({
        type: "GET",
        url: myurl,
        cache: false,
        cors: true,
        headers: {
            'Access-Control-Allow-Origin': '*',
            "Content-Type": "text/json; charset = utf-8"
        },
        success: function (data) {
            console.log(data);
            $(data).find('ArrayOfString').each(function () {
                $(this).find("string").each(function () {
                    emailAddress += $(this).text() + ";";
                });

            });

        },
        error: function (a, b, c) {
            console.log(a);
            alert("Error");
        }
    });