473,387 Members | 1,549 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,387 software developers and data experts.

Window's property resets on refresh!? can it be preserved???

Hi,

In order to preserve some settings and avoid cookies I have thought of the
following trick:

I simply create an array as the property of the window:

window.aList = new Array();

and add the values to be preserved for after refresh.

While I can add the values fine, once I refresh the page the array is reset,
or at least it appears to be!

Any idea how cen I preserve the property of the the window????

TIA,

Tom
Jul 17 '05 #1
9 1629
looks like you are using client side java script. right? this is not the
right way to do it. a browser refresh is a separate request to your server.
to preserve data between requests, use sessions on the server.

"Tom Szabo" <to*@intersoft.net.au> wrote in message
news:41********@dnews.tpgi.com.au...
Hi,

In order to preserve some settings and avoid cookies I have thought of the
following trick:

I simply create an array as the property of the window:

window.aList = new Array();

and add the values to be preserved for after refresh.

While I can add the values fine, once I refresh the page the array is
reset,
or at least it appears to be!

Any idea how cen I preserve the property of the the window????

TIA,

Tom

Jul 17 '05 #2
"konsu" <ko***@hotmail.com> wrote in message
news:R_********************@kallback.com...
looks like you are using client side java script. right? this is not the
right way to do it. a browser refresh is a separate request to your server. to preserve data between requests, use sessions on the server.


thanks but can't, I need to preserve the state in a java script control
Jul 17 '05 #3
may be you can describe the reason why you need to do it? what is your task?
in general. may be you can save the state in to a file on the client? but
you cannot do it by setting properties of the window because your script
code has effect only until another request. after that the browser flushes
everything, including the window object and memory.

"Tom Szabo" <to*@intersoft.net.au> wrote in message
news:41********@dnews.tpgi.com.au...
"konsu" <ko***@hotmail.com> wrote in message
news:R_********************@kallback.com...
looks like you are using client side java script. right? this is not the
right way to do it. a browser refresh is a separate request to your

server.
to preserve data between requests, use sessions on the server.


thanks but can't, I need to preserve the state in a java script control

Jul 17 '05 #4
On Fri, 3 Dec 2004 09:31:56 -0800, "konsu" <ko***@hotmail.com> wrote:
may be you can describe the reason why you need to do it?


maybe you can explain why you need to top post?
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://signup.databasix.com
================================================== =========================
Jul 17 '05 #5
.oO(Gary L. Burnore)
On Fri, 3 Dec 2004 09:31:56 -0800, "konsu" <ko***@hotmail.com> wrote:
may be you can describe the reason why you need to do it?


maybe you can explain why you need to top post?


Maybe you can explain why you have a 12-line sig?

SCNR
Micha
Jul 17 '05 #6
>>may be you can describe the reason why you need to do it?

maybe you can explain why you need to top post?


what are you talking about?
Jul 17 '05 #7
"Tom Szabo" <to*@intersoft.net.au> wrote in message news:<41********@dnews.tpgi.com.au>...
"konsu" <ko***@hotmail.com> wrote in message
news:R_********************@kallback.com...
looks like you are using client side java script. right? this is not the
right way to do it. a browser refresh is a separate request to your

server.
to preserve data between requests, use sessions on the server.


thanks but can't, I need to preserve the state in a java script control


I think you're supposed to use biscuits or crackers or something to
do stuff like that... cookies ... brownies ... ???
Jul 17 '05 #8
I am getting a little confused:

Normally if I don't know what is the best way of doing something, I will ask
a question like:

How should I do this?

In this case, I simply asked the question if something is possible?

I don't think top-posting would be a lot more annoying than receiving advice
why should you do something differently, etc...

Besides I beleive it is possible with a little workaround...:-)
Jul 17 '05 #9
"Tom Szabo" <to*@intersoft.net.au> wrote in message news:<41********@dnews.tpgi.com.au>...
Hi,

In order to preserve some settings and avoid cookies I have thought of the
following trick:
That's what cookies are for! Bummer that they have been so abused
that users turn them off completely.


I simply create an array as the property of the window:

window.aList = new Array();

and add the values to be preserved for after refresh.

While I can add the values fine, once I refresh the page the array is reset,
or at least it appears to be!
Sure, that's what happens. You've loaded a fresh page. Same page but
initialized.
Any idea how cen I preserve the property of the the window????


Even if you use session variables at the server, you're still
going to need to use a cookie or url query string.

Just use a cookie and educate your users. People need to know that
session cookies are safe. We are missing out on too much by not
using cookies, and it just ain't right that the spammers, etc.
have scared users away from cookies. Dang....
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ben Smeets | last post by:
Hi folks, Have been trying to figure out a solution for the following problem by reading lots of threads here, but doesn't work out. Hope someone can help me. I have a parent window which...
1
by: stellabein | last post by:
Hi friends, I am very very new to programing. i have a one main window from that window i am opening one modal window using showmodaldialog(m.jp...). in that modal window i have a form. when i...
1
by: Pikolo Mondo | last post by:
hello, i've got a child window which will refresh the parent window after it closes heres the catch, if i use window.open() it works fine, but when i use window.showModelessDialog, the child window...
12
by: martin1 | last post by:
All, is there window form refresh property? I try to set up window form refresh per minute. Thanks
7
by: senaka | last post by:
Hi, I want to refresh the properties window in Visual Studio through my code. This is how it works. I have made an onChanged event for a property that I defined. When this gets fired I need to...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.