我的ajax調用加載document.ready時出現問題,但是當我合併一個窗口時。滾動功能的Ajax調用成功呈現任何建議,我可以如何調整我的代碼。ajax調用文檔準備好
function DataStreamer(){
$.ajax({ // then make an AJAX-request
async: false,
cache: false,
url: '/APAC/TW/Resources/js/gethistoricalpricing.js',
dataType: 'json', // csv data is text
success: function(resp) { // "resp" variable is a response to AJAX-request
// Append new data into the 'ds1' data set
var line = [], json = resp, i= 0;
for (i; i < resp.length; i++) {
rawDate = json[i]['Date'].split('/');
hisDate = rawDate[2] + rawDate[0] + rawDate[1];
hisPrice = json[i]['Price'];
line.push("\n"+hisDate + "," + hisPrice);
}
chart.appendData('ds_prices', line);
// getSeriesById method returns 's1' series 'main' chart,
// you can also use full path to the series through the objectModel, but this way is shorter
chart.commitDataChanges();
}
})
}
$(document).ready(function(){
DataStreamer();
});
什麼是'chart'? –
它仍然沒有被觸發 –
@RohanKumar我認爲它是「anychart」 –