[英]Origin null is not allowed by Access-Control-Allow-Origin while doing jquery ajax Get
I'm trying to use jquery ajax to download xml from here: http://www.maciejko-sklep.pl/components/com_esklep/integracja.php?type=cenuj&pass=JH64HU7 我正在尝试使用jquery ajax从此处下载xml: http : //www.maciejko-sklep.pl/components/com_esklep/integracja.php? type=cenuj&pass=JH64HU7
or either html: link: http://www.maciejko-sklep.pl/components/com_esklep/integracja.php?type=html&pass=4FMIHGfd 或html:链接: http : //www.maciejko-sklep.pl/components/com_esklep/integracja.php? type=html&pass= 4FMIHGfd
and I get this error Origin null is not allowed by Access-Control-Allow-Origin. 我收到此错误,Access-Control-Allow-Origin不允许使用Origin null。
I'm trying to figure this out, anyone knows how to fix this and somehow download content from either of those links. 我正在尝试弄清楚这一点,任何人都知道如何解决此问题以及以某种方式从这些链接中的任何一个下载内容。 Ps when i paste the link in url it works fine, but i cannot send ajax requests.
Ps,当我将链接粘贴到url时,效果很好,但是我无法发送Ajax请求。 THX
谢谢
除非服务器明确启用了cors ,否则跨域ajax请求受浏览器的限制。
Add this to the top of your php file: 将此添加到您的php文件的顶部:
<?php header('Access-Control-Allow-Origin: *'); ?>
It solved my issue with access-control-allow-origin 它通过access-control-allow-origin解决了我的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.