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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing/Appending to a .txt file

Status
Not open for further replies.

rgee

Technical User
Jul 3, 2000
6
0
0
GB
Is it possible to use a JScript to open a .txt file and add some data from, say, a prompt dialog;<br><br>ie. when visitor clicks on a link, up pops the prompt requesting the visitors name. when they click OK, it writes the name into file 'visitors.txt'. The visitor continues on to the linked destination.<br><br>Make sense??<br><br>Cheers<br><br>Rob
 
It is not possible using client-side javascript, except perhaps in an HTA (HTML Application). Using server-side JScript and the FileSystemObject it is possible using CreateAsTextFile (I think) and OpenAsTextStream.<br><br><A HREF="mailto:jared@aauser.com">jared@aauser.com</A>
 
I'm unclear... I thought Server-side JavaScript was specific to Netscape servers. I'm sure Perl would do the trick for you, though... <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
&gt;...server-side javascript specific to netscape servers<br><br>Not at all. ASP can use javascript as its scripting language. There are many things you can do with it (open files,move files, create folders,etc. I use it everyday :).<br><br>Anyways, while much of ASP is done using VBScript, a greater majorit of people are starting to use JSscript. Go to <A HREF=" TARGET="_new"> and check it out... (actually so many people are using jscript on the server-side now that microsoft is creating a compilable version of jscript called JSCRIPT.NET which has protected variables and classes and types and what not)<br><br><A HREF="mailto:jared@aauser.com">jared@aauser.com</A><br>
 
But ASP isn't the same thing as server-side JavaScript... When ASP uses JavaScript, that's a little different. If you were using Netscape servers, you'd be able to use JavaScript on the server without needing a server page language like ASP.<br><br>You can use any server page language you have access to... JSP can do it, ASP can do it, etc... or, if you need to go with CGI, that can do it to (w/Perl). Depends on your options... but regular JavaScript by itself can not do it. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top