gpt4 book ai didi

ajax - 跨域请求被阻止 : The Same Origin Policy disallows reading the remote resource at

转载 作者:行者123 更新时间:2023-12-03 11:16:12 24 4
gpt4 key购买 nike

我正在使用 CometChat在我的网站上,最近我的用户在接收消息时遇到了这个问题。在 FireBug 中检查后,我意识到脚本失败一定是因为 CORS 保护(由于以下错误)。

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://x3.chatforyoursite.com/subscribe/... This can be fixed by moving the resource to the same domain or enabling CORS.



现在我想知道我应该在哪里启用 CORS,因为它在我自己的服务器上启用并且我无法访问 CometChat服务器。

最佳答案

服务器在 x3.chatforyoursite.com需要输出以下标题:
Access-Control-Allow-Origin: http://www.example.com
哪里http://www.example.com是你的网址。您应该在 chatforyoursite.com 上检查您的设置看看您是否可以启用此功能 - 如果不能,他们的技术支持可能是解决此问题的最佳方法。但是,要回答您的问题,您需要远程站点以允许您的站点访问 AJAX 响应客户端。

关于ajax - 跨域请求被阻止 : The Same Origin Policy disallows reading the remote resource at,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24182259/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com