I'm currently having some trouble using the jQuery properly. I'm trying to load some csv files (ie google.com) via jQuery.get, and build some graph. Somehow the jQuery just cannot load the file properly.Here is my code:
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).keypress(function(e) {if(e.keyCode == 13) {updateData();};});
drawchart("2013.04.02")
function drawchart(date){
jQuery.ajaxSetup({async:false});
var sql = "http://www.andrewpatton.com/countrylist.csv";
console.log(sql);
var ans= jQuery.get(sql);
ans.done(...draw...);
ans.fail(console.log("fail"));
}
</script>
</head>
<body>
<input id="date-input" style=margin-left:160px type="text" id="date" name="date" />
<input type="button" value="submit" onClick="updateData();"/>
<p style=margin-left:160px> Date format: YYYY.MM.DD </p>
</body>
</html>
I have tested the url, and it indeed returns me a .csv file when I enter the url in the browser, so my guess is that there's something with the jQuery that I don't get...
Can someone tell me what might be going on?