HighDots Forums  

Re: Persistent Variable across pages

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Re: Persistent Variable across pages in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Randy Webb
 
Posts: n/a

Default Re: Persistent Variable across pages - 01-05-2007 , 07:01 PM






Jonas Smith said the following on 1/5/2007 6:12 PM:
Quote:
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.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.