I'm trying to call the Yahoo Finance api which returns some data in the form of a CSV file.
I'm trying to do this in Javascript and as per below but it's failing.
$.ajax({
type: "GET",
url: "http://finance.yahoo.com/d/quotes.csv?s=RHT+MSFT&f=sb2b3jk",
dataType: "text",
success: function(data) {
// when successful
}
}).error(function(jqXHR, textStatus, errorThrown) {
console.log("error " + textStatus);
console.log("incoming Text " + jqXHR.responseText);
console.log("error THrown " + errorThrown);
});
How do I figure out what the error message is? I've tried putting a callback on the error, but all the parameters are empty except for textStatus which is returning "error".