javascript variables persisting across a reload?

Discussion in 'Javascript' started by Andy Fish, Aug 18, 2003.

  1. Andy Fish

    Andy Fish Guest

    Hi,

    Can anyone tell me if there is a way to set a variable in javascript and
    have that persist so that it can be picked up by the next page in the
    window?

    In this case I will actually navigate to the page myself by setting
    document.URL. I am happy to do this in a different way but I don't want to
    pop up a sub window. I want to pass some javascript stuff into the next page
    without having to serialize it all and post it to the server.

    Andy
    Andy Fish, Aug 18, 2003
    #1
    1. Advertising

  2. Andy Fish wrote:
    > Hi,
    >
    > Can anyone tell me if there is a way to set a variable in javascript and
    > have that persist so that it can be picked up by the next page in the
    > window?
    >
    > In this case I will actually navigate to the page myself by setting
    > document.URL. I am happy to do this in a different way but I don't want to
    > pop up a sub window. I want to pass some javascript stuff into the next page
    > without having to serialize it all and post it to the server.


    You would need to redesign your web page to use a frameset, then you can
    store variables in
    top.varName
    and they are persisted as long as only the frame with your content is
    changed.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Aug 18, 2003
    #2
    1. Advertising

  3. Andy Fish

    Andy Fish Guest

    thanks

    I think I will do something similar to your suggestion but use window.opener
    instead since my window has a 'parent'

    "Martin Honnen" <> wrote in message
    news:...
    >
    >
    > Andy Fish wrote:
    > > Hi,
    > >
    > > Can anyone tell me if there is a way to set a variable in javascript and
    > > have that persist so that it can be picked up by the next page in the
    > > window?
    > >
    > > In this case I will actually navigate to the page myself by setting
    > > document.URL. I am happy to do this in a different way but I don't want

    to
    > > pop up a sub window. I want to pass some javascript stuff into the next

    page
    > > without having to serialize it all and post it to the server.

    >
    > You would need to redesign your web page to use a frameset, then you can
    > store variables in
    > top.varName
    > and they are persisted as long as only the frame with your content is
    > changed.
    >
    >
    >
    > --
    >
    > Martin Honnen
    > http://JavaScript.FAQTs.com/
    >
    Andy Fish, Aug 18, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shawn McNiven

    Persisting Information across forms

    Shawn McNiven, Apr 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    389
    Richard Saunders
    Apr 7, 2004
  2. John Hoge

    Persisting form data across page load

    John Hoge, Nov 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    393
    =?Utf-8?B?S3Jpc2g=?=
    Nov 29, 2004
  3. Stu
    Replies:
    3
    Views:
    4,957
  4. =?Utf-8?B?U2lvYmhhbg==?=

    Persisting user login credentials across pages

    =?Utf-8?B?U2lvYmhhbg==?=, Feb 20, 2005, in forum: ASP .Net
    Replies:
    19
    Views:
    819
    =?Utf-8?B?U2lvYmhhbg==?=
    Feb 28, 2005
  5. Joshua Beall
    Replies:
    26
    Views:
    219,906
    AndreiKaa
    Jun 29, 2007
Loading...

Share This Page