本地JavaScript可以在同一本地计算机上编辑/保存文件吗?如何使用jQuery? [英] Can local JavaScript edit/save files on same local machine? How using jQuery?

查看:83
本文介绍了本地JavaScript可以在同一本地计算机上编辑/保存文件吗?如何使用jQuery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一些本地运行的CSS驱动的站点地图,用于审核巨大的Intranet站点.我已经对该功能进行了编码,以打开一个上下文菜单,该菜单提供用于更新index.html DOM的选项.我想将这些更改保存到index.html.

I'm building a little locally run CSS driven site map for auditing a huge intranet site. I've already coded the ability, to bring up a context menu which provides for options to make updates to the DOM of index.html. I would like to save these changes to index.html.

我知道JavaScript不允许对客户端文件系统进行操作,但是我还阅读了一些从本地计算机检索JavaScript的地方.

I know JavaScript doesn't allow manipulation to the client file system, but I've also read in places that it is allowed if the JavaScript is retrieved from the local machine.

任何人都可以确认这一点,并指出正确的方向如何在不设置本地服务器的情况下完成此操作吗?

Can anyone confirm this and point me in the right direction on how this can be done WITHOUT setting up a local server?

推荐答案

可以使用Filewriter对象写入本地文件系统,如下所述:

It is possible to write to the local filesystem using the Filewriter object, as described here: http://www.html5rocks.com/en/tutorials/file/filesystem/

这篇关于本地JavaScript可以在同一本地计算机上编辑/保存文件吗?如何使用jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆