十四、FileReader()

function printFile(file) { var reader = new FileReader(); reader.onload = function(evt) { console.log(evt.target.result); }; reader.readAsText(file); }

  1. readAsArrayBuffer()
  2. readAsBinaryString()
  3. readAsDataURL()
  4. readAsText()

    推荐阅读