Created
December 2, 2022 15:46
-
-
Save budRich/4ed8b58a132db9093dd43b8287b1a477 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="file" id="inputfile"> | |
<br> | |
<pre id="output"></pre> | |
<script type="text/javascript"> | |
document.getElementById('inputfile') | |
.addEventListener('change', function() { | |
var selected_file = new FileReader() | |
selected_file.onload = function(){ | |
// let data = fr.result.trim().split('\n').map(x => parseInt(x)) | |
document.getElementById('output').textContent = selected_file.result | |
} | |
selected_file.readAsText(this.files[0]); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment