瀏覽代碼

Изменить 'ace/index.html'

master
KaiSD 5 年之前
父節點
當前提交
50fa7e8b4b
共有 1 個檔案被更改,包括 1 行新增8 行删除
  1. +1
    -8
      ace/index.html

+ 1
- 8
ace/index.html 查看文件

@@ -159,18 +159,11 @@
input.type = 'file';

input.onchange = e => {

// getting a hold of the file reference
var file = e.target.files[0];

// setting up the reader
var reader = new FileReader();
reader.readAsText(file,'UTF-8');

// here we tell the reader what to do when it's done reading...
reader.onload = readerEvent => {
var content = readerEvent.target.result; // this is the content!
editor.setValue(content);
editor.setValue(readerEvent.target.result);
editor.clearSelection();
}



Loading…
取消
儲存