From 6270e0259c9d3c54033d3e9508a3a71a45916d45 Mon Sep 17 00:00:00 2001 From: reviewher Date: Sun, 12 Sep 2021 00:55:10 -0700 Subject: [PATCH] knockout demo update [ci skip] --- demos/knockout/index.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/demos/knockout/index.html b/demos/knockout/index.html index 9560631..ad72b6d 100644 --- a/demos/knockout/index.html +++ b/demos/knockout/index.html @@ -58,17 +58,16 @@ model.aoa.push([7,8,9]); /* set up file input handler */ (function() { var input_dom_element = document.getElementById('xlf'); - var rABS = true; // true: readAsBinaryString ; false: readAsArrayBuffer function handleFile(e) { var files = e.target.files, f = files[0]; var reader = new FileReader(); reader.onload = function(e) { var data = e.target.result; - if(!rABS) data = new Uint8Array(data); - var workbook = XLSX.read(data, {type: rABS ? 'binary' : 'array'}); + data = new Uint8Array(data); + var workbook = XLSX.read(data, {type: 'array'}); process_wb(workbook); }; - if(rABS) reader.readAsBinaryString(f); else reader.readAsArrayBuffer(f); + reader.readAsArrayBuffer(f); } input_dom_element.addEventListener('change', handleFile, false); })();