Alan Budzinski
Alan Budzinski

Reputation: 809

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. P.s. when i paste the link in url it works fine, but i cannot send ajax requests. THX

Upvotes: 1

Views: 2602

Answers (3)

Paul Graffam
Paul Graffam

Reputation: 2149

Add this to the top of your php file:

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

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

Upvotes: 0

aziz punjani
aziz punjani

Reputation: 25776

Cross domain ajax requests are restricted by the browser, unless the server explicitly has cors enabled.

Upvotes: 1

Related Questions