No 'Access-Control-Allow-Origin' header is present on the requested resource.
时间: 2023-09-01 17:11:13 浏览: 161
解决方案 ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘*’
5星 · 资源好评率100%
This error occurs when the requested resource does not include the "Access-Control-Allow-Origin" header. This header is required to allow cross-origin resource sharing (CORS) and is used to restrict which origins can access the resource.
To resolve this issue, you can add the "Access-Control-Allow-Origin" header to the server response. The value of this header should be the origin (domain) from which the request originates or "*" to allow access from any origin.
Here is an example of how to include the header in a server response using JavaScript:
```
response.setHeader("Access-Control-Allow-Origin", "*");
```
Please note that allowing access from any origin using "*" can pose security risks, so it's recommended to restrict access to specific origins whenever possible.
If you are not the owner of the server or do not have access to modify the server-side code, you can try reaching out to the server administrator or the website owner to address this issue.
阅读全文