aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes can we maintain a javascript variable in session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "can we maintain a javascript variable in session" Watch "can we maintain a javascript variable in session" New topic
Author

can we maintain a javascript variable in session

rachana ravali
Ranch Hand

Joined: Jun 20, 2006
Posts: 32
Hi ,
I am new to javascript and java.Please help i am having the following problem :
i have to set a variable when any change is made in a jsp page.
i am using onChange for that and calling a javascript function to set the variable.
problem is that i have to maintain the value as changed (if any data in the table is changed) even if the user goes to some link like help and return back to the table page.

thanks in anticipation.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

There really isn't a good way of doing this with just Javascript. You are going to need to get that data available on the server to persist in some way (Session maybe). Without knowing more details about what you are actually doing it's hard to give you a good solution. Ajax *might* work here, but I hate to say anything for sure without more information.


GenRocket - Experts at Building Test Data
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
possible answers are: a. client, b. server.

1) Where is the javascript engine?

2) Where is a JSP parsed/translated?

This may seem very basic, sorry. We'll get to the answer.

- whoops, fixed a link.
[ May 16, 2007: Message edited by: Garrett Smith ]

comp.lang.javascript FAQ: http://jibbering.com/faq/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can we maintain a javascript variable in session