[英]Write to a file without external JS libraries (pure Javascript) in a browser ?
Is it possible to write a string to a file (create the file if it doesn't exist) without any external Javascript libraries , purely with Javascript code ? 是否可以在没有任何外部Javascript库的情况下,仅使用Javascript代码将字符串写入文件(如果不存在,则创建文件)?
I'm trying to implement a client side code that whenever it reaches a page (.ASPX) it writes few strings into a file (let's say output.txt
) and that's it . 我正在尝试实现一个客户端代码,只要它到达页面(.ASPX),它就会向文件中写入几个字符串(比如
output.txt
),仅此而已。
From everything I see over the internet , JavaScript is not allowed to write anything to the hard drive . 从我在互联网上看到的一切来看,不允许JavaScript向硬盘驱动器写入任何内容。
Is that so ? 是这样吗 ? no workarounds ?
没有解决方法?
As said in the comments, what you sound to try to achieve is intentionally very restricted for obvious security reasons of the visitor's machine. 如评论中所述,出于访问者机器的明显安全原因,您试图实现的目标非常受限制。
Now "workarounds" could exist, depending on the actual objective you are trying to achieve (but which you did not mention). 现在,可能会存在“变通办法”,具体取决于您要实现的实际目标(但您没有提到)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.