I want to load a *.csv file from a path wich the user can choose.
The path I get: C:\\Users\\...
But the $.get
method can't read this path. How does the path have to look like?
$.get(pathAndFile, function (data) {...
I want to load a *.csv file from a path wich the user can choose.
The path I get: C:\\Users\\...
But the $.get
method can't read this path. How does the path have to look like?
$.get(pathAndFile, function (data) {...
If you wanted to read CSV data in JavaScript from a computer you would need to instruct the user to select the file (there is no way around this, with the possible exception of a virus). However once a user selected a file you can read and parse CSV data with a small amount of JavaScript like this (demo)
With this HTML:
And this JavaScript:
You can generate an HTML table from the contents of a CSV file (this is based on this excellent site)