-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
28 lines (26 loc) · 709 Bytes
/
Copy pathtest.html
File metadata and controls
28 lines (26 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test parser</title>
<script src="js/transform.js"></script>
</head>
<body>
<script>
document.getElementById('data/test-txt.txt').onchange = function(){
var x = this.files[0];
var reader = new FileReader();
reader.onload = function(progressEvent){
console.log(this.result);
var lines = this.result.split('\n');
let syllables = []
for (var line = 0; line < lines.length; line++){
syllables.push(lines[line]);
}
};
console.log(syllables);
reader.readAsText(x);
};
</script>
</body>
</html>