Persistent Variable across pages

J

Jonas Smith

What is the best way to pass a value between pages accessed from the
hard drive? (The user downloads the whole manual and reads it locally
from his hard drive.)

I'm trying to create a script that enables the user to set the page's
font size from a drop down menu. It's fairly easy to do, however, the
manual being read is comprised of multiple files, so it is very
desirable that the font size can be set only once per session and the
font size is available to the script when accessing different pages.

I tried saving the value that the user selects through the menu in a
cookie, and the scripts starts by checking for that cookie. It works in
Firefox and other Gecko based browsers (the cookie has no domain), but
it doesn't work in Safari. Safari won't save a cookie that didn't come
from a server. I don't have IE handy to check if it works with it.

So, is there a better way to pick up the font size value set in one page
from another page?
 
R

Randy Webb

Jonas Smith said the following on 1/5/2007 6:12 PM:
What is the best way to pass a value between pages accessed from the
hard drive? (The user downloads the whole manual and reads it locally
from his hard drive.)

I'm trying to create a script that enables the user to set the page's
font size from a drop down menu. It's fairly easy to do, however, the
manual being read is comprised of multiple files, so it is very
desirable that the font size can be set only once per session and the
font size is available to the script when accessing different pages.

I tried saving the value that the user selects through the menu in a
cookie, and the scripts starts by checking for that cookie. It works in
Firefox and other Gecko based browsers (the cookie has no domain), but
it doesn't work in Safari. Safari won't save a cookie that didn't come
from a server. I don't have IE handy to check if it works with it.

So, is there a better way to pick up the font size value set in one page
from another page?

If you want a persistent variable then the most fool proof way would be
to have a simple frameset with a hidden frame that holds all your
variables. Then they are accessible from the child page via the frames
collection.

The drawback is the frames issue where it creates a saved navigation
nightmare.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top