JSFiddle - React, Tailwind, and code Playground
HTML
<button id="a">click me</button>
JavaScript
function get_url(remote_url) {
$.ajax({
url: "http://query.yahooapis.com/v1/public/yql?"+
"q=select%20*%20from%20html%20where%20url%3D%22"+
encodeURIComponent(remote_url)+
"%22&format=json",
type: 'get',
dataType: 'jsonp',
success: function(data) {
alert(data.query.results.body.p);
},
error: function(jqXHR, textStatus, errorThrow){
alert(jqXHR['responseText']);
}
})
}
$('#a').click(function() {
get_url('http://ichart.finance.yahoo.com/table.csv?format=json&s=GS&a=00&b=1&c=2010&d=08&e=3&f=2012&g=d&ignore=.csv');
});