No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '…' is therefore not allowed access

后端 未结 11 1755
醉话见心
醉话见心 2020-11-22 14:27

I\'m using .htaccess to rewrite urls and I used html base tag in order to make it work.

Now, when I try to make an ajax request I get the following error:

11条回答
  •  遇见更好的自我
    2020-11-22 14:40

    Pleaes find the Function used in XMLHTTPREQUEST in Javascript for setting up the request headers.

    ...
    
    xmlHttp.setRequestHeader("Access-Control-Allow-Origin", "http://www.example.com");
    ...
    
    
    

    Reference: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader

提交回复
热议问题