在我获取历史信息的过程中,我尝试使用以下代码.Chrome调试器说明了这一点Uncaught ReferenceError: $ is not defined.你能提出一个解决方案吗,我真的被卡住了.我只需要在Chrome上工作,我正在使用YQL和Yahoo API.
这里是jsFiddle http://jsfiddle.net/pCK5q/1/
<html>
<head>
<script type='text/javascript' src='http://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages':['annotatedtimeline']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
/* historical data code that breaks */
var url = 'http://query.yahooapis.com/v1/public/yql';
var startDate = '2012-01-01';
var endDate = '2012-01-08';
var jsonData = encodeURIComponent('select * from yahoo.finance.historicaldata where symbol in ("YHOO","AAPL","GOOG","MSFT") and startDate = "' + startDate + '" and endDate = "' + endDate + '"');
$.getJSON(url, 'q=' + data …Run Code Online (Sandbox Code Playgroud)