07-27-2023, 12:02 AM
I am trying to use the webservice prestashop (1.6) to get my product by using the jquery function getJSON() but on the console's browser, I get the following error :
XMLHttpRequest cannot load
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://localhost' is therefore not allowed access.
I tried to add " Header set Access-Control-Allow-Origin: * " to the htaccess but without success.
I wonder if there is another way to set a header (except using php with `header('Access-Control-Allow-Origin: *');` )
XMLHttpRequest cannot load
[To see links please register here]
.No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://localhost' is therefore not allowed access.
I tried to add " Header set Access-Control-Allow-Origin: * " to the htaccess but without success.
I wonder if there is another way to set a header (except using php with `header('Access-Control-Allow-Origin: *');` )