the following code works fine on Safari.
On Chrome, it fails due to:
"XMLHttpRequest cannot load file:///Users/jem/Sites/AA/data/articles.csv. Origin null is not allowed by Access-Control-Allow-Origin."
What does this mean? How can I properly read this file using a synchronous call?
function(file) {
var content;
$.ajax({
url : file,
success : function (data) {
content = data.split(/\r\n|\n/);
},
async: false
});
return content;
}
The problem is that chrome does not allow you to load files from your local system by default using ajax. This is a security setting.
Start Chrome using the –allow-file-access-from-files parameter to skip this security check.
chrome.exe –allow-file-access-from-files