0

I need to write to a text file using JavaScript. I have a machine I need to run some HTML file on and it uses JS to manipulate content. I want to log the changes the user makes in a text file, and the computer does not have and will never have any server-side scripting language. So I just wanna know how to append text to a txt file using JS only. Alternatively, running a batch script upon JS call that will do the work itself, is a good equivalent, but I'm sure it's the same level of difficulty...

The script will work on an IE only machine, but I need to be able to test it on other browsers as well... So I'm not sure how and if ActiveX works on Chrome for example, but if it doesn't, I need another solution... Help please! :)

asked May 4, 2012 at 0:24
3
  • Good luck... I doubt it's gonna work as well as you want. Commented May 4, 2012 at 0:26
  • Why do you want to manipulate a text file? Do you need an actual .txt, or are you just looking for persistant client-side storage? Commented May 4, 2012 at 0:52
  • The web app I'm making is a listing changer for some company. The limitation on that computer is that no software can be installed, including a server... and I need to create an automated log for the listing changes. I literally need just to write to a .txt file. Commented May 6, 2012 at 21:49

2 Answers 2

1

Not exactly the solution I was looking for, but I ended up using cookies, which limits the amount of data I can hold to very little, but beats nothing.

answered Jun 16, 2012 at 19:47
Sign up to request clarification or add additional context in comments.

Comments

0

While there's some promise with the new File API, you'll probably need to go with a server-sided language for reliable file-writing.

Some possible alternatives are to 'write' the changes to the localStorage, or perhaps to create a URI download. There's plenty of tutorials online for setting these up. Good luck!

answered May 4, 2012 at 0:32

2 Comments

As the question states, I'm limited to browser technology only. No server client-scripting, this computer can't have a server installed an has no internet access even. I need to paste my HTML/JS files and be able to create and append a text file so that it would log things relevant to the script.
As for localStorage, this machine runs IE6 with no possibility to upgrade/change... So I'm not capable of using HTML5

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.