In the following code:
var rawFile = new XMLHttpRequest();
rawFile.open("GET", "file://csvFileName.csv", true);
console.log(rawFile);
var input = $.csv.toObjects(rawFile);
console.log(input);
I'm trying to convert a .csv file into a readable file, and then I'm trying to run a .toObjects command on it to produce a csv file that's easier to work with, but I keep running into an "Uncaught TypeError: csv.replace is not a function" error on the fourth line. I'm using the most upvoted answer to this question as a basis.
I've read through the documentation but I can't seem to find a particular answer to this error, does anyone know of a fix?
edit: this isn't my entire code, I have a script link to the jquery plugin in my html header. This is just the section where the error is. link looks like:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/0.71/jquery.csv-0.71.min.js"></script>