2

I'm developing the following for local use:

I've got a HTML page, with some content.

Is it possible to edit the content of this HTML through the browser, and save the changes on-the-fly to this same file using only JavaScript? So the users could edit the file through the browser and it would auto-save itself.

The problem is, I have no possibility to use server-side languages here. It should be compatible with the latest Firefox, other browsers aren't important.

2
  • @Alin, you can generate pages only with javascript and with data coming from various sources. Especially for the browser he targets. Commented Dec 30, 2010 at 9:16
  • Must have been blind at the moment. I missed the first line... "I'm developing the following for local use". Commented Dec 30, 2010 at 9:21

3 Answers 3

2

Nope, you can't save server-side files using only native Javascript.

However, there seem to be some Java FTP Applets around that are scriptable from JavaScript. See this SO question.

Other than that, you need something on the server side receiving and writing the data.

Sign up to request clarification or add additional context in comments.

Comments

2

No, this is not possible without backend code.

1 Comment

It was not possible until recently, since some browsers now support the File System Access API.
2

If the changes are only for that user, you can parse the data of the page and store them locally. Using some of the HTML5 goodies: http://diveintohtml5.ep.io/storage.html

Then, when the user comes back, render it with a Javascript template engine.
My heart goes to PURE but there's plenty of other options if you prefer the double brackets family of templates.

If the changes are for all users, you could call a third server you own(appEngine, Amazon,...), to store the data, and deliver them through JSONP. And again render them with a JS template engine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.