I am trying to make a webpage where the page would refresh every second or so new and updated data can be displayed on it.
What I want the code to do is it would read a text file from my PC using its directory automatically, and the tutorials I have researched all show the need of using input, is there any other way to do this where it would just instead need or read from a file directory?
My code so far:
html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-bandwith, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="refresh" content="1">
<title>IOT WEATHER STATION</title>
</head>
<body id = 'body'>
<div style="display:inline-block;vertical-align:top;">
<img src="sinewaves.png" alt="graph">
</div>
<div style="display:inline-block;">
<script src = "script.js"></script>
</div>
</body>
</html>
Javascript:
const reader = new FileReader()
reader.onload = function(){
console.log(reader.result)
}
reader.readAsText('testing.csv')
console.log("TEST")