我的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” –