I do not have access to the .htaccess server and need to enable cors in jQuery
The code to access the 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 are:
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
In .htaccess I would activate using:
Header set Access-Control-Allow-Origin "*"
In php I would activate using:
<?php header('Access-Control-Allow-Origin: *'); ?>