Created
October 12, 2022 15:24
-
-
Save nhattruongniit/4499678dd747421fe7e6a535098fbfb3 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
| function open_file(e) { | |
| var file = e.target.files[0]; | |
| if (!file) { | |
| return; | |
| } | |
| var reader = new FileReader(); | |
| reader.onload = function(e) { | |
| var contents = JSON.parse(e.target.result); | |
| if (contents!=null) { | |
| app.data = Object.assign(app.data,contents) | |
| app.update() | |
| } | |
| }; | |
| reader.readAsText(file); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment