Add gitignore and use response.text()
This commit is contained in:
parent
a96c9df1f5
commit
e92c0b1a4f
2 changed files with 6 additions and 15 deletions
3
.gitignore
vendored
Executable file
3
.gitignore
vendored
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
/_site
|
||||||
|
.idea
|
||||||
|
.jekyll-cache
|
16
spec.js
16
spec.js
|
@ -28,21 +28,9 @@ parseExcel = function (file) {
|
||||||
};
|
};
|
||||||
lk.onchange = ev => parseExcel(lk.files[0]);
|
lk.onchange = ev => parseExcel(lk.files[0]);
|
||||||
szak.onchange = async ev => {
|
szak.onchange = async ev => {
|
||||||
/*let response = await fetch(document.URL.substr(0,document.URL.lastIndexOf('/'))+'/pti_bsc.xlsx');
|
|
||||||
let data = await response.blob();
|
|
||||||
parseExcel(data);*/
|
|
||||||
/*let isCacheSupported = 'caches' in window;
|
|
||||||
if (isCacheSupported) {
|
|
||||||
let cache = await caches.open("targyak");
|
|
||||||
//await cache.add("https://oktweb.neptun.u-szeged.hu/tanterv/tanterv.aspx?kod=BSZKPTI-N1");
|
|
||||||
}*/
|
|
||||||
if (szak.value === "nope") return;
|
if (szak.value === "nope") return;
|
||||||
let reader = new FileReader();
|
|
||||||
let response = await fetch(document.URL.substr(0, document.URL.lastIndexOf('/')) + '/data/' + szak.value + "_bsc.csv");
|
let response = await fetch(document.URL.substr(0, document.URL.lastIndexOf('/')) + '/data/' + szak.value + "_bsc.csv");
|
||||||
let data = await response.blob();
|
let data = await response.text();
|
||||||
reader.onload = ev => {
|
let obj = Papa.parse(data);
|
||||||
let obj = Papa.parse(reader.result);
|
|
||||||
console.log(obj);
|
console.log(obj);
|
||||||
}
|
|
||||||
reader.readAsText(data);
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue