Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript - Read and Write a text file

Status
Not open for further replies.

jbgood

Technical User
Oct 30, 2003
4
US
I am trying to create a number to use on my web page
I Don't think I need anything too fancy.
I just want to keep it in a text file on my website and when I need to access it, I want to be able to read it from the file, use in in a form field, increment it by 1 and write the changed text file back.

So how do I...
Read the number from a text file...
Assign it to a variable...
Use it in a form field...
Increment it by 1...
Write it to the text file...
Save the text file...

I am at a loss about how to read and write, open and save a text file with JavaScript.

If I can't do this using JavaScript, I have plan B...
How do I get a js generated number into a web form text field?

Thanks

Jack
 
why not use server side language like ASP? javascript is client side.

Known is handfull, Unknown is worldfull
 
Like vbkris says javascript is client side. To maintain security javascript is restricted to running inside IE and has no access to the local file system - its therefore not possible using js. A signed Java applet would do it but by this stage you might as well set up a little access database.

I dont know how it would work in ASP as I know little about it.

Matt

Matt
 
Thanks Guys

I at least know which way to go..


CatchYaLater
Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top