There's a CSV file uploaded to the server that I want to parse using javascript/jquery.
I'm trying to get the file using ajax call but it's always giving me error.:
XMLHttpRequest cannot load https://1fichier.com/?w5hfqz60tk&_=1474818392318. No 'Access-Control-Allow-Origin' header is present on the requested resource.
$.ajax({
url:'https://1fichier.com/?w5hfqz60tk',
type: "GET",
dataType: "text",
success: function (data){
parseFile(data);
},
error:function(e){
}
});
I need to run the above code in jsFiddle.. How can I bypass this error?
Or is there any alternative way to download a file?
Update: I just found out that adding url like this: https://crossorigin.me/MY_HTTP(S)_LINK solved my problem but I'm looking for an authentic way.
console.dir(e)in your error function