I can't seem to get a CSV stock file from yahoo finance to "success"-fully load. I've tested different callbacks and suggestions from other questions, but none of them seem to be working - most of them don't output anything.
$(document).ready(function(){
$.ajax({
url:"http://finance.yahoo.com/d/quotes.csv?s=XOM&f=sn",
dataType: 'jsonp',
success: function(data) {
alert('good');
},
error: function(data) {
alert(data);
}
});
});
?This code alerts [object Object]
(the "error" callback), however the CSV file can be seen in the network panel successfully. The data in the network panel reads "XOM, Exxon Mobile Corpo" as expected (so it did load).
I guess the real question is how can I get that data which I know is loaded. I just want to alert
it for now... just want to see it on the page. I've spent a countless number of hours fiddling with this and it just doesn't work.
Here's a jsfiddle:
http://jsfiddle.net/V94sQ/3/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…