我如何阅读本地文本文件与JavaScript? [英] How do I read in a local text file with javascript?
问题描述
我试过了很多东西,但是到目前为止我看到的东西是不可能出于安全原因,或者它不起作用正常。我
这是我目前的代码:
http:/ /pastebin.com/uKvEfvZZ
使用 HTML5文件API 。它允许您在本地选择和读取文件。
I am trying to use to select a file locally and read the text in it line by line to interpret it. My program is meant to read a text file and read questions from it to make a test taking program. The file should not be uploaded, and only read locally. It is okay if the solution only works on chrome and firefox.
I have tried looking through many things, but so far what I seem to see is that it is not possible for security reasons, or it is but it doesn't work properly. I
This is my current code: http://pastebin.com/uKvEfvZZ
Use HTML5 file API. It allows you to select and read files locally.
这篇关于我如何阅读本地文本文件与JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!