Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How can I save a variable?
Old 04-16-2008, 04:01 PM How can I save a variable?
leadingzero's Avatar
tired of the day job

Posts: 89
Trades: 1
I'm putting some js on my web page but I need to save some text. Is there a way for JS to write to a file on the server?

(I don't want to write to a file on the client side with ActiveX).

Any other suggestions?
leadingzero is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-17-2008, 01:01 PM Re: How can I save a variable?
Average Talker

Posts: 18
Name: TK
Trades: 0
Since Javascript is a client-side side scripting, you'll need to have a server-side script to do the actual writing to a server-side file. If you don't want to use an HTML form to submit the data (perhaps through a hidden form variable), you'll basically be designing a AJAX-like system using a Javascript XMLHttpRequest object.

You intimated that this would be user-based information when you mentioned the idea of storing the data on the client side. How about using a cookie to store the data? David Flanagan's examples of defining a cookie class and using the cookie class may prove helpful here.
zxcvbnm60 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How can I save a variable?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41702 seconds with 12 queries