I use d3.CSV() function, and it works. Nevertheless, it gives a blank error!
I have to figure out this problem as it may cause complications later.
CSV file:
Food,Rating
Pizza,90
Ice Cream,92
Spaghetti,85
Tuna Salad,75
Script:
<script>
d3.csv("food.csv", function(error,data) {
if (error) {
console.log("error messages: ", error)
} else {
console.log(data)
}
})
</script>
Output:
test.html:17 error messages: {Food: 'Pizza', Rating: '90'}
test.html:17 error messages: {Food: 'Ice Cream', Rating: '92'}
test.html:17 error messages: {Food: 'Spaghetti', Rating: '85'}
test.html:17 error messages: {Food: 'Tuna Salad', Rating: '75'}
Line 17 in the HTML file is:
console.log("error messages: ", error)