<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input type="file" name="">
<script type="text/javascript">
var input=document.querySelector("input");
input.onchange=function(){
//獲取到文件
var file=this.files[0];
//開始讀取,創建讀取器
var reader=new FileReader();
//開始讀取
reader.readAsText(file);
//獲取讀取的結果
//當文件讀取完成后,才可以獲取文件信息內容
reader.onload=function() {
console.log(reader.result);
}
}
</script>
</body>
</html>
- 開發工具
- VsCode
- 常用插件
- Html5
- 標簽
- video
- form
- 讀取文件
- 地理位置
- canvas
- 本地存儲
- localStorage
- sessionStorage
- 網絡狀態
- Css3
- 背景
- 邊框
- 邊框圖片
- 文字陰影
- 漸變
- Js
- ES6
- 常量和變量
- 模板字符串
- 箭頭函數
- 解構賦值
- Spread Operator
- import export
- Promise
- 打包
- webpack
- 安裝
- 為什么要打包
- 核心概念
- 熱更新
- 入門例子
- js打包
- css打包
- vue
- 簡介
- Vue-cli
- 搭建
- 打包發布
- eslint
- Mint-ui
- Vuex
- 狀態管理模式
- 使用
- main.js
- store
- component
- Mockjs
- 簡介
- EasyMock