1
I don’t have access to .htaccess server and need to enable Cors on jQuery
The code to access Webservice is:
$(document).ready(function(){
jQuery.support.cors = true;
$.ajax({
url: 'https://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote',
crossDomain:true,
dataType: 'text/xml',
success: function(response){
console.log(response);
}
});
});
The request headers is:
Request Headers
:authority:finance.yahoo.com
:method:GET
:path:/webservice/v1/symbols/allcurrencies/quote
:scheme:https
accept:*/*
accept-encoding:gzip, deflate, br
accept-language:pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
origin:http://localhost
referer:http://localhost/biblioteca/cotacao/jQueryYahooFinance/
user-agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/59.0.3071.109 Chrome/59.0.3071.109 Safari/537.36
No . htaccess I would activate using:
Header set Access-Control-Allow-Origin "*"
In php I would activate using:
<?php header('Access-Control-Allow-Origin: *'); ?>
I thought I could, because I can through PHP.
– Valter Junior