编辑网页并在本地保存更改 [英] Make edits to a webpage and save the changes locally

查看:346
本文介绍了编辑网页并在本地保存更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望找到一种方式让其他人编辑html网页(在本地找到),并允许他们保存他们所做的更改。



我知道这是一个奇怪的要求,我有一个非常具体的想法,我将在下面作为一个可选的阅读为有兴趣的人。



我发现这个代码在地址栏可用于编辑: document.body.contentEditable ='true'; document.designMode =上;无效0



然后,我发现只需添加:

 < div id =columnscontentEditable =true> 

可以完成工作,因为我可以编辑html。



问题是我无法保存更改。我曾尝试以多种不同格式保存网页,包括网页/完整,仅限HTML,TXT文件。



是否有保存这些编辑是通过保存HTML还是使用一些其他类型的简单存储?

推理:
我有一个简单的本地html页面,我将与其他同事一起使用。这些同事不太懂技术(甚至比我还少)。试图解释如何编辑html并对文本进行更改的提及试图创建空洞的目光,并且不愿意在该项目上工作。我非常希望他们能够从前端编辑这个HTML页面的文本,而不是搞乱任何编码。
另外,我已经安装了一个Xampp服务器和wordpress - 这已经变得有点矫枉过正,并且让其他人感到困惑。



谢谢, 您可以使用 rel =nofollow> localStorage 将数据保存在用户的浏览器中。


I am wanting to find a way I can have others edit a html webpage (found locally) and allow them to save the changes they have made.

I know this is an odd request, I have a very specific idea in mind, which I will include below as an optional read for those interested.

I found that this code in the address bar works for the editing: document.body.contentEditable='true'; document.designMode='on'; void 0

Then I found that just adding:

 <div id="columns" contentEditable="true">

gets the job done since I can edit the html.

The problem is that I cannot save the changes. I have tried saving the page in several different formats, including webpage/complete, HTML only, TXT file.

Is there anyway to save these edits whether by saving the HTML or using some other kind of simple storage?

Reasoning: I have a simple local html page I will be using with other co-workers. These co-workers are not very tech-savvy (even less than me). The very mention of trying to explain how to edit the html and make changes to the text created blank stares, and an unwillingness to work on the project. I would very much prefer for them to be able to edit the text of this HTML page from the front end and not mess up any of the coding. Also, I have installed a Xampp server, and wordpress - this has become a bit overkill for the purpose and again, has confused the others.

Thanks,

解决方案

You can use localStorage to save the data in the user's browser.

这篇关于编辑网页并在本地保存更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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