javascript variables persisting across a reload?

A

Andy Fish

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
 
M

Martin Honnen

Andy said:
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.
 
A

Andy Fish

thanks

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top