简体   繁体   中英

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

or either html: link: 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.

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. THX

除非服务器明确启用了cors ,否则跨域ajax请求受浏览器的限制。

Add this to the top of your php file:

<?php header('Access-Control-Allow-Origin: *'); ?>

It solved my issue with access-control-allow-origin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM