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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

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.
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: can we maintain a javascript variable in session
 
Similar Threads
Regarding to retain hidden variable on click of browser back button
unexpected call to method or property access
table tag passed from servlet
updating table in oracle through JSP
Showing an element of a list after a certain interval