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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Szabo

    #1

    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


  • konsu

    #2
    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]


    Comment

    • Tom Szabo

      #3
      Re: Window's property resets on refresh!? can it be preserved???

      "konsu" <konsu@hotmail. com> wrote in message
      news:R_udnRNSMa KNejLcRVn-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


      Comment

      • konsu

        #4
        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_udnRNSMa KNejLcRVn-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]


        Comment

        • Gary L. Burnore

          #5
          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@databa six 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
          =============== =============== =============== =============== ===============

          Comment

          • Michael Fesser

            #6
            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

            Comment

            • konsu

              #7
              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?


              Comment

              • Razzbar

                #8
                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.co m.au>...[color=blue]
                > "konsu" <konsu@hotmail. com> wrote in message
                > news:R_udnRNSMa KNejLcRVn-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 ... ???

                Comment

                • Tom Szabo

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


                  Comment

                  • Razzbar

                    #10
                    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.co m.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....

                    Comment

                    Working...