Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-19-2007, 03:25 AM   PM User | #1
glz
New Coder

 
Join Date: Apr 2007
Posts: 57
Thanks: 3
Thanked 0 Times in 0 Posts
glz is an unknown quantity at this point
Question writing to a text file with javascript

Hello I'm having trouble writing to a text file with javascript, i've tried writing to a local text file on my own PC, and I've also tried writing to a local file on my own server, (which I have all permissions to do so...)

I'd really like to write to a file that resides on my own web server.
Here is my code:

Code:
<head>
<SCRIPT LANGUAGE="JavaScript">
 function WriteToFile() {
    
    set fso = CreateObject("Scripting.FileSystemObject");  
    set s = fso.CreateTextFile("C:\test.txt", True);
    s.writeline("HI");
    s.writeline("Bye");
    s.writeline("-----------------------------");
    s.Close();
 }
  </SCRIPT>
</head>
<body>
<form onSubmit="WriteToFile()">
<input type="submit" value="Run the WriteToFile Function!">
</form> 
</body>

quite frankly it just doesn't work, you know what I want to do, I gave you my attempt, please help me do it

thank you
glz is offline   Reply With Quote
Old 06-19-2007, 04:03 AM   PM User | #2
smalldog
Regular Coder

 
Join Date: May 2007
Posts: 118
Thanks: 0
Thanked 0 Times in 0 Posts
smalldog is an unknown quantity at this point
Why don't use rather some server side script language? Javascript is the client side script so don't try to perform some actions on the server side, ASP and PHP are the server side scripting languages and that's the right choice.
__________________
Forum for webmasters and developers
http://www.htmlfrenzy.com
Are you an IT expert? Join our Reward system
www.htmlfrenzy.com/reward-system.php
smalldog is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:18 PM.


Advertisement
Log in to turn off these ads.