Please consider this javascript:
$.ajax({ url:'http://ichart.finance.yahoo.com/table.csv?s=GS&a=00&b=1&c=2010&d=08&e=3&f=2012&g=d&ignore=.csv', type:'get', dataType:'jsonp', success:function(data){ alert(data); } })
The url returns a CSV file, but I am specifying a jsonp data type because it is an ajax request for a cross-domain. Without this parameter, I get the error "origin is not allowed".
Since I am specifying a jsonp data jsonp , the ajax function throws an error because the CSV file is not a JSON format. But in the dev console, I see that the browser receives a coherent CSV file. Therefore, I know that I am successfully receiving a CSV file. I think this should be possible, but I'm not sure how to properly get this csv file for my ajax function ??
Of course, if I could get this URL to return a properly formatted JSON string that would be the best, but I'm not sure I can.
Here is a fiddle where you can try, you have to open the dev console to see this error: http://jsfiddle.net/92uJ4/3/
Any help is greatly appreciated.
Tim
source share