Make CORS Ajax requests using XMLHttpRequest

前端 未结 1 973
迷失自我
迷失自我 2020-12-10 04:44

This is the code to validate geoJSON according to the sample provided:

 function processSuccess(data){
            if(data.status===\"ok\")  console.log(\"Yo         


        
相关标签:
1条回答
  • 2020-12-10 05:33

    You shouldn't be setting Access-Control-Allow-Origin as a request header, that's a response header.

    You can see from the response what request headers the server will accept:

    Access-Control-Allow-Headers:Origin,Content-Type,Accept
    

    And the error message tells you that:

    Request header field Access-Control-Allow-Origin is not allowed
    

    It looks like it might not accept X-Requested-With either.

    0 讨论(0)
提交回复
热议问题