Hello,
Since this is a continuation of your last question[
^] I am putting up a small snippet to show how this can be done (Assuming parameter ticker represents value you want to replace.
function createChart(ticker) {
$.support.cors = true;
$.ajax({
type: 'GET',
async: false,
dataType: "json",
url: 'http://query.yahooapis.com/v1/public/yql',
data: { q:'SELECT * FROM yahoo.finance.historicaldata WHERE symbol="' + ticker + '" AND startDate="2013-01-01" AND endDate="2013-04-3"',
format:'json', diagnostics:true, env:'store://datatables.org/alltableswithkeys'},
crossDomain:true,
success: function (data, status, jqXHR) {
renderChart(data, status, jqXHR);
},
error: function (jqXHR, status, error) {
console.log('Error: ' + error);
}
});
}
Regards,