如何使用JavaScript创建文本文件?

ana*_*99g 5 javascript google-chrome creation filesystemobject text-files

我正在尝试使用javascript创建一个文本文件.我尝试了以下代码,但这没有用.请给我一个解决方案.谢谢 .

var fso, file;
fso = new ActiveXObject("Scripting.FileSystemObject");
file = fso.CreateTextFile("c:\\Mytest\test.txt");
file.Close();
Run Code Online (Sandbox Code Playgroud)

Pra*_*h K 4

您不能使用ActiveXObject来完成此操作,因为它只能在 Internet\xc2\xa0Explorer 中工作...查看HTML5 的文件系统 API可能会对您有所帮助。

\n