473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to avoid update of a js variable

1
Hi,
i m using a js variable to store a data from a jsp page.But when page is refreshed, the date will be updated.
I want the data available even after page refresh. Is there a way to do this?
Sep 8 '11 #1
2 1253
Dormilich
8,658 Expert Mod 8TB
not unless you save that outside the realm of JS (e.g. cookies or using the sessionStorage)
Sep 8 '11 #2
Samishii23
246 100+
One possible way is to have the pages load through Ajax.
For example load the initial page then have ajax call data and load a "Main" container with the page.

jQuery uses easy ajax calls, and can even get specific chunks of an HTML page. Like loading a page with a div with the id "stuff" and it'll return only the html of that div.

Other then that its not really possible unless like Dorm said to use cookies or session storage. Cause HTML pages are static documents and were not meant to be Dynamic, until JS, then Ajax was born.

Good luck
Sep 13 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: lkrubner | last post by:
how does one set a variable so as to avoid errors like this: Notice: Undefined variable: arrayToCapture in /home/httpd/vhosts/publicdomainsoftware.org/httpdocs/pdsIncludes/McControllerForAll.php...
6
by: rong.guo | last post by:
Hello, I am trying to update variable 'Type' (which is a pre-defined variable without any value in it). Is there a way to combine Step1 to Step3 into one single Update? I tried the query at the...
6
by: Igor | last post by:
Hi, I have tab control on one of which pages is subform. When I change data on one of pages and navigate to another, update in database is happened. Is there any way to avoid that? Thanks
1
by: Wing | last post by:
Hi all, I have created 2 tables in sql database and join these 2 tables before assign the result to the dataset, and display the result in datagrid. Everything is fine up to this point. The...
3
by: raj | last post by:
hi, I have 4 forms all having 40 fields in datagrid,I have two textBoxes for date and country, according to my requirement if i have set date and country in one form then if i go to another form...
3
by: Phil Townsend | last post by:
I have a class that contains three local variables. I need to write a method that updates one of these at a time based on a condition. I would like to do this without writing a bunch of redundant...
3
by: BuddyWork | last post by:
I want to know what is the best design approach to update a variable across threads.
0
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
I just use queryString ("image") to keep generated chart in the middle panel with top menu and bottom table when user select different chart varibale like Unit on the dropdownlist button and enter...
2
by: Kevin | last post by:
I am having difficulty updating a variable page-time-stamp in the following snippit. The variable time-stamp is initialized from the attribute time-stamp from the log element. Some of the page...
1
by: donken | last post by:
Hi I'm trying to update changes made in a dataset to an existing .dbf file. But I can't figure it out. I connect to the file via ODBC connection and the updates to the DataSet works fine but then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.