jQuery .load() 访问控制允许来源
我正在尝试使用 jQuery .load()
将网站内容加载到 div 中,并且遇到 Access-Control-Allow-Origin 问题,该脚本认为我正在尝试进行跨域加载,但是一切都在同一台服务器上。
我尝试加载的内容来自同一站点,但由于域的设置方式出现了问题,特别是当域作为 http://
加载请求访问时有效,但是当以 http://www.
访问域时,我遇到访问控制问题。
我想知道如何解决这个问题,因为所有内容都在同一服务器和同一网站上。
I am trying to load site content in to a div using jQuery .load()
and am getting problems with Access-Control-Allow-Origin, the script thinks I am trying to do a cross domain load but everything is on the same server.
The content I am trying to load is from the same site but because of the way to domains are set up problems are occurring, specifically when the domain is accessed as http://<domain>
load request works, however when the domain is accessed as http://www.<domain>
I get the Access-Control issue.
I would like to know how I can solve this as everything is on the same server and same website.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题的解决方案是: easyxdm
至少......它解决了我们服务器(具有许多不同域)的很多麻烦和担忧......
the solution for your problem is: easyxdm
At least...it solved a lot of troubles and concerns at our server(s) (with many different domains)...