我在JavaScript中编写代码打开文件然后阅读它:
var txtFile = "/dataset/happy.txt";
var fileH = new File(txtFile);
var fileS = new File("/dataset/sad.txt");
var fileA = new File("/dataset/angry.txt");
var fileSC = new File("/dataset/scared.txt");
var fileSU = new File("/dataset/suprised.txt");
fileH.open("r"); // open file with read access
但我得到(ReferenceError:File未定义)错误 问题是什么?
谢谢:)