2
我遇到了一些代碼的問題。這裏是JSON響應的樣子:
{"cars":"1","bikes":"1"}
這裏是jQuery代碼:
$(function() {
$.getJSON('https://myurlhere.com?filename=aapl-c.json&callback=?', function(data) {
// Create the chart
$('#container').highcharts('StockChart', {
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Stock Price'
},
series: [{
name: 'AAPL',
data: data,
tooltip: {
valueDecimals: 2
}
}]
});
});
});
這是我得到的錯誤:
SyntaxError: missing ; before statement {"cars":"1","bikes":"1"}
我在做什麼錯這裏?