XMLHttpRequest cannot load https://webservice.com?param=hahah. Origin http://{domain} is not allowed by Access-Control-Allow-Origin.
I get this when I try to make a webservice call through wampserver, how could I enable this on wampserver?
or how may i just jsonP to obtain xml data without javascript throwing an error.
You have to enable the headers module first, like so :
And then include this in your apache config:
(in httpd.conf or in the configuration of your vhost)
(Instead of the * you can also specify a specific domain)
Hope this will solve your problem -
To add the CORS authorization to the header using Apache, simply add the following line inside either the , , or sections of your server config (usually located in a *.conf file, such as httpd.conf or apache.conf), or within a .htaccess file:
For all requests -
For trusted hosts -