readAsText()
메서드는 지정된 Blob
이나 File
의 컨텐츠를 읽기 위해 사용합니다. 읽기 연산이 끝나면, readyState
가 DONE
으로 바뀌고, loadend
이벤트가 트리거 되고, result
프로퍼티는 파일의 내용을 텍스트 문자열로 가집니다.
새로운 API 사용가능
Blob.text()
메서드는 파일을 텍스트로 읽는 프로미스 기반의 새 API 입니다.
문법
instanceOfFileReader.readAsText(blob[, encoding]);
매개변수
명세
Specification | Status | Comment |
---|---|---|
File API The definition of 'readAsText()' in that specification. |
Working Draft | Initial definition |
브라우저 호환성
BCD tables only load in the browser