简体   繁体   English

如何使用jQuery写入本地JSON文件

[英]How to write to local JSON file using jQuery

Please note; 请注意; everything I'm doing here is local. 我在这里所做的一切都是本地的。 I've been looking for and testing ways to write to a JSON from a JS file using jQuery. 我一直在寻找和测试使用jQuery从JS文件写入JSON的方法。 I've found ways that use PHP, but I'm not fluent in PHP and would rather stay away from it for now. 我已经找到了使用PHP的方法,但是我不太熟练使用PHP,因此暂时不要使用它。

Is there any function in jQuery, or JavaScript, that can let me easily write to JSON files? jQuery或JavaScript中是否有任何功能可以让我轻松地写入JSON文件?

Thanks in advance, Benjamin. 预先感谢本杰明。

If you are going with browser then it will not work in any way. 如果要使用浏览器,则它将无法以任何方式运行。 If you are using nodejs on local system then you can do it with nodejs. 如果您在本地系统上使用nodejs,则可以使用nodejs来实现。 With only remote side script it is not possible. 仅使用远程脚本是不可能的。 With javascript running in browser you can only perform browser based task. 在浏览器中运行javascript时,您只能执行基于浏览器的任务。

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

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