【发布时间】:2016-03-24 06:27:26
【问题描述】:
我正在尝试将 html 从 url 加载到网页上的 div 容器,但我收到此错误“请求的资源上不存在 'Access-Control-Allow-Origin' 标头。来源 'null' 是因此不允许访问。”
我的网站仅使用 html 和 jquery/javascript 构建。
$('.myContainer').load('http://s3-ap-southeast-1.amazonaws.com/myfolder/mypage.html')
请告诉我如何解决此错误?
【问题讨论】:
-
您不能进行“跨域”调用来加载 URL。这里描述了一些解决方案,例如。 stackoverflow.com/questions/15005500/…
标签: javascript jquery html cross-domain cors