dimanche 4 janvier 2015

No 'Access-Control-Allow-Origin' header


I embedded a third-party javascript script into a page. It's for tracking the events from a video on the page. But I get an error:



XMLHttpRequest cannot load http://ift.tt/1ymKKAA.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://fast.wistia.net' is therefore not allowed access.


I know there're the solutions to that error but they, probably, would be applicable if it were my own script.


For some reason I believe it has to do with the settings on my web server which is apache. So I added this to /etc/apache2/sites-enabled/my_domain.com but it didn't help.



<VirtualHost *:80>
Access-Control-Allow-Origin: "http://fast.wistia.net"`


I also tried adding Access-Control-Allow-Origin: "*" but yet it didn't pan out.


How do I fix the error?



Aucun commentaire:

Enregistrer un commentaire