【问题标题】:XMLHttpRequest cannot load XXX No 'Access-Control-Allow-Origin' headerXMLHttpRequest 无法加载 XXX 没有 \'Access-Control-Allow-Origin\' 标头
【发布时间】:2022-12-02 18:40:09
【问题描述】:

tl;dr; About the Same Origin Policy

I have a Grunt process which initiates an instance of express.js server. This was working absolutely fine up until just now when it started serving a blank page with the following appearing in the error log in the developer\'s console in Chrome (latest version):

XMLHttpRequest cannot load https://www.example.com/ No \'Access-Control-Allow-Origin\' header is present on the requested resource. Origin \'http://localhost:4300\' is therefore not allowed access.

What is stopping me from accessing the page?

  • I\'m working on the website and it was fine five minutes ago.
  • does it issue CORS headers? perhaps if you shared some code it would be easier to see
  • Plausibly. Which department should I ask to find out? I just do the backbone.marionette stuff mostly...
  • Yeah. I suppose the organisations of departments isn\'t always uniform anyway, so it is possibly a nebulous question but I would like to know a bit of the backend/routing/sys-admin stuff at my company and this seemed like a good excuse to familiarise myself so if there are problems in future I can help out.
  • I would ask someone on the server side inside your operation. They must have changed it on you if you were able to access it before.

标签: javascript cors same-origin-policy


【解决方案1】:
【解决方案2】:
【解决方案3】:
【解决方案4】:
【解决方案5】:
【解决方案6】:
【解决方案7】:
【解决方案8】:
【解决方案9】:
【解决方案10】:
【解决方案11】:
猜你喜欢
相关资源
最近更新 更多