There has a problem. I read data from a CSV file then store the innerHTML to a var(named content), it can read by the browser and the type is a string. When I going to convert it to the array, it not work. I tried split() but it does not work correctly for me.
function readAsText() {
var file = document.getElementById("file").files[0];
var reader = new FileReader();
reader.readAsText(file);
reader.onload = function (f) {
var result = document.getElementById("result");
result.innerHTML = this.result;
content = result.innerHTML
arr1 = content.split(" /n")
arr2 = content.split(" ")
}
}
As the picture, split() can split the string, but the result in a single item
