Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Tom Szabo
Guest
 
Posts: n/a
#1: Jul 17 '05
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



konsu
Guest
 
Posts: n/a
#2: Jul 17 '05

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


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" <tom@intersoft.net.au> wrote in message
news:41af39d3$1@dnews.tpgi.com.au...[color=blue]
> 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
>
>[/color]


Tom Szabo
Guest
 
Posts: n/a
#3: Jul 17 '05

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


"konsu" <konsu@hotmail.com> wrote in message
news:R_udnRNSMaKNejLcRVn-3A@kallback.com...[color=blue]
> 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[/color]
server.[color=blue]
> to preserve data between requests, use sessions on the server.[/color]

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


konsu
Guest
 
Posts: n/a
#4: Jul 17 '05

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


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" <tom@intersoft.net.au> wrote in message
news:41b07f7a$1@dnews.tpgi.com.au...[color=blue]
> "konsu" <konsu@hotmail.com> wrote in message
> news:R_udnRNSMaKNejLcRVn-3A@kallback.com...[color=green]
>> 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[/color]
> server.[color=green]
>> to preserve data between requests, use sessions on the server.[/color]
>
> thanks but can't, I need to preserve the state in a java script control
>
>[/color]


Gary L. Burnore
Guest
 
Posts: n/a
#5: Jul 17 '05

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


On Fri, 3 Dec 2004 09:31:56 -0800, "konsu" <konsu@hotmail.com> wrote:
[color=blue]
>may be you can describe the reason why you need to do it?[/color]

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
================================================== =========================
Michael Fesser
Guest
 
Posts: n/a
#6: Jul 17 '05

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


.oO(Gary L. Burnore)
[color=blue]
>On Fri, 3 Dec 2004 09:31:56 -0800, "konsu" <konsu@hotmail.com> wrote:
>[color=green]
>>may be you can describe the reason why you need to do it?[/color]
>
>maybe you can explain why you need to top post?[/color]

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

SCNR
Micha
konsu
Guest
 
Posts: n/a
#7: Jul 17 '05

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


>>may be you can describe the reason why you need to do it?[color=blue]
>
> maybe you can explain why you need to top post?[/color]

what are you talking about?


Razzbar
Guest
 
Posts: n/a
#8: Jul 17 '05

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


"Tom Szabo" <tom@intersoft.net.au> wrote in message news:<41b07f7a$1@dnews.tpgi.com.au>...[color=blue]
> "konsu" <konsu@hotmail.com> wrote in message
> news:R_udnRNSMaKNejLcRVn-3A@kallback.com...[color=green]
> > 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[/color]
> server.[color=green]
> > to preserve data between requests, use sessions on the server.[/color]
>
> thanks but can't, I need to preserve the state in a java script control[/color]

I think you're supposed to use biscuits or crackers or something to
do stuff like that... cookies ... brownies ... ???
Tom Szabo
Guest
 
Posts: n/a
#9: Jul 17 '05

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


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...:-)


Razzbar
Guest
 
Posts: n/a
#10: Jul 17 '05

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


"Tom Szabo" <tom@intersoft.net.au> wrote in message news:<41af39d3$1@dnews.tpgi.com.au>...[color=blue]
> Hi,
>
> In order to preserve some settings and avoid cookies I have thought of the
> following trick:[/color]

That's what cookies are for! Bummer that they have been so abused
that users turn them off completely.

[color=blue]
>
> 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![/color]

Sure, that's what happens. You've loaded a fresh page. Same page but
initialized.
[color=blue]
> Any idea how cen I preserve the property of the the window????[/color]

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....
Closed Thread