网站首页技术博客

ajax跨域Access-Control-Allow-Origin​

洞天水月2021-03-12 14:32:282142人次阅读
摘要ajax跨域Access-Control-Allow-Origin

ajax跨越域名操作会提示

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

解决方法,在目标页面声明header标示授权

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

*标示所有网址

文章评论

  • 10月02日 17:24 xzsdetn

    ehen45n

  • 10月02日 17:24 gwqge

    aeghhewrhjrey