我是很新的Javascript和我想執行這個stockchart從這個URL做工精細:http://jsfiddle.net/2zBRt/2/的Javascript stockchart圖
The code is excatly the same from the URL, some minor changes are made to ensure that the JQuery library is called
不過,我不斷收到此錯誤:
(1) Uncaught TypeError: Cannot call method 'setDefaults' of undefined
(2) Uncaught TypeError: Object [object Object] has no method 'datepicker'
Code:
function(chart){
// apply the date pickers
setTimeout(function(){
$('input.highcharts-range-selector',
$('#'+chart.options.chart.renderTo)).datepicker()
},0)
});
// Set the datepicker's date format
$.datepicker.setDefaults({
dateFormat: 'yy-mm-dd',
onSelect: function(dateText) {
this.onchange();
this.onblur();
}
});
請幫助我,我的老闆呼吸嚴重下來我的脖子
我如何定義函數? –
看來,datepicker是一個CLASS,setDefaults是datepicker的方法,或者乾脆刪除這兩個函數,圖表仍然工作 –