简体   繁体   English

打印到文件javascript

[英]print to file javascript

I'm wondering.. how could I output a string to a file (and create said file) in javascript? 我想知道..如何在JavaScript中将字符串输出到文件(并创建所述文件)?

I'm using this for Chrome extension development. 我正在使用它进行Chrome扩展程序开发。

出于安全原因,您不能使用基于浏览器的客户端Javascript在计算机上创建,读取或修改文件。

If you want to do this from within a browser, it won't work except you might use activex or java (via plugins). 如果您想从浏览器中执行此操作,它将无法正常工作,除非您可能使用activex或java(通过插件)。

Or you fetch yourself the spidermonkey (mozilla's javascript engine) source code and compile it into a command line application. 或者,您自己获取Spidermonkey(mozilla的javascript引擎)源代码,并将其编译为命令行应用程序。 You will get file access this way. 您将以这种方式获得文件访问权限。

Cheers, -S 干杯,-S

您将信息发布到http处理程序(asp.net中的ashx,或仅是php站点),然后将信息写入文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM