Hi All,
I need to cache some javascript variable values across the page.
Consider page 1 has a javascript variable which holds some value and If the user take page 2 and clicks the browser back button the javascript variable value on page 1 will be lost. How can i cache the javascript variable value on page 1. Please help me to solve this issue

Thanks

Recommended Answers

All 3 Replies

-Here, try this stunt: (I never tried it)

Write it in the hidden input of the first page - I'm almost sure the Back-Button will not clear its value - and than read it back with your script.

!But, beware that any other way of geting back to the first page, ie clicking a link to it will most certainly clear your var value!

I already tried the technique of using a hidden variable. It didn't work.

can you give me an example of how did you use a "hidden variable" please so I can look into it and see what's the problem?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.