function ReadFile var fr new FileReader fr readAsText file files fr on

 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
29
30
function ReadFile()
{
var fr = new FileReader();
fr.readAsText(file.files[0]);
fr.onload = function (r)
{
getElementById('list') = List(r.target.result);
}
}
function List(info) {
var people = info.split('\r\n\r\n');
var list = '';
for (var i in people)
{
var row = people[i].split('\r\n');
var items = '';
for (var j in row)
{
if (j === '0') {
items += '<li><li>' + row[j] + ',';
}
else {
items += row[j] + '</li></li>';
}
}
list += items;
}
return '<ul>' + list + '</ul>'
}