是否有可能写入到使用JavaScript(在磁盘)的文件?

是否有可能写入到使用JavaScript(在磁盘)的文件?

问题描述:

我是新手,中级程序员采取刺在阿贾克斯。虽然JavaScript的阅读,我发现它奇怪,大多数我已经吸取了使用PHP进行这种操作的例子。我知道你们许多人可能会说,我做错了或者JavaScript是一种客户端的语言等,但问题的立场。 。 。可你写一个文件中唯一的JavaScript?

I am a novice-intermediate programmer taking a stab at AJAX. While reading up on JavaScript I found it curious that most of the examples I've been drawing on use PHP for such an operation. I know many of you may argue that 'I'm doing it wrong' or 'JavaScript is a client-side language' etc. but the question stands. . .can you write a file in only JavaScript?

编辑:对不起,刚刚看了常见问题,没有提到这是我在#1的第一篇文章,而我希望我没有冠冕堂皇的议论,华而不实,或主观

Sorry, just read faq, failed to mention this my first post on Stackoverflow while I hope I'm not sounding argumentative, pompous, or subjective.

是的,你当然可以。这只是取决于什么API对象的JavaScript引擎向您提供。

Yes, of course you can. It just depends on what API objects your javascript engine makes available to you.

不过,赔率是JavaScript引擎,你正在考虑不提供此功能。绝对没有任何的主流浏览器将允许它。

However, odds are the javascript engine you're thinking about does not provide this capability. Definitely none of the major web browsers will allow it.