I am building like local html file to process csv log data and visualise that data using chart.js. This html file will always be used offline.
But at the first hurdle I can't seem get a success on the ajax request for the local csv file.
file:///Users/joshmoto/Sites/charts-app/data/LOG-01.csv
100% the csv file exists in this local location. If I right click 'open link in new tab via my console log, it automatically downloads the csv so it's definitely here. Theoretically my code below should not be returning an error response.
$.ajax({
url: "//Users/joshmoto/Sites/chart/data/LOG-01.csv",
dataType: "text",
success: function(data) {
alert("worked");
},
error: function (request, status, error) {
alert("broken");
}
});
I've also tried data type POST
and GET
but still always alerts me the error message.
Any ideas in where I'm going wrong would be hugely appreciated.