[Javascript] Passing variables from one page to another

tedd tedd at sperling.com
Wed Dec 27 12:33:39 CST 2006


At 10:06 AM -0800 12/27/06, Ian Skinner wrote:
>I'm trying to see how js can pass variables from one web page to another.
>
>  >From what I've read, it appears that I can attach a variable to a
>window.parent.
>
>In my mind you are talking about two different things here.  When 
>talking about window.parent, ect one is talking about windows opened 
>by other code.  So a popup of some sort opened by JS in the parent 
>which then can pass data back to the window that created it.
>
>But when talking about passing variables from one web page to 
>another, I picture from one request to another.  This requires using 
>something like cookies, get and|or post headers.
>
>Ian Skinner
>Web Programmer

Ian:

Granted my thinking at the moment is a bit fuzzy -- I may not need, 
or want window.parent, but from what I've read, it looked like a 
possibility. So, let me back up and see if there is another way.

There are several ways that I can pass variables between pages in 
php, such as to use sessions or cookies, but those are required 
because the operations are server-side and thus stateless.

I know that I can pass variables back and forth between js and php, 
but those are problematic and require the user to do something, I 
don't want the hassle.

What I want is a way for javascript (client-side) to pass variables 
from one web page to another. It seems to me that a client-side 
operation should be able to provide for this.

For example, if I declare var a=1; in the index page (init on load), 
then how can I find out what it's value is in the contact page? Or is 
my thinking here too fuzzy?

tedd

-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the Javascript mailing list