jQuery表单插件:XMLHttpRequest无法加载http://www...No'Access-Control-Allow-Origin' [英] jQuery Form Plugin : XMLHttpRequest cannot load http://www.....No 'Access-Control-Allow-Origin'
问题描述
我基于 jQuery Form插件插件
最近,我发现自己遇到了这个错误
Recently, i find myself in front of this error
XMLHttpRequest cannot load http://www.****.com/. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://****.com' is therefore not allowed access.
以前没有发生过.并非所有文件都发生这种情况,但是在我的最后一种情况下,.zip文件(包含images的zip文件,50MB,但是我认为这并不重要)会发生.
This don't happen before. It doesn't happen with all files, but in my last case happens with an .zip file (a zip file with images , 50MB , but i think this isn't important).
我已经阅读了关于类似问题的几个问题,但在加载文件时却没有阅读
I have read several questions on SO about a similar problem, but not when loading a file
推荐答案
您似乎误解了该问题.我怀疑这与文件的大小有关.
It looks like you have misinterpreted the problem. I doubt it has anything to do with the size of the file.
查看错误消息:
cannot load http://www.test.com/
和'http://test.com' not allowed access
.
您要将要在浏览器中加载的网站从www.test.com
更改为test.com
,并在此过程中向其提出跨源请求.
You're changing the site you are loading in your browser from www.test.com
to test.com
and are making it a cross-origin request in the process.
- 在代码中使用相对URL
- 选择一个主机名来托管您的网站
- 将请求从另一个主机名重定向到它
这篇关于jQuery表单插件:XMLHttpRequest无法加载http://www...No'Access-Control-Allow-Origin'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!