Ajax redirect problem

Why does the problem of redirection occur when using ajax to request other websites

        $.ajax({
            url:"https://www.baidu.com",
            type:"GET",
            headers:{
                "Access-Control-Allow-Origin":"*"
            },
            success:function(){
                console.log(33);
            },
            error:function(){
                console.log(344);
            }
        })
        

how to deal with this situation?

Feb.28,2021

Access-Control-Allow-Origin is the Response, set by the server. You need Baidu to configure whether the current website can cors


unless Baidu cooperates with you

.
Menu