|
how can a variable be passed form one webpage to another.
through javascript.
could you please explain.
t y
h o
a u
n
k
|
|
|
To do this requires more technologies than javascript alone, but here are a three options for you.
One option is to have each page read the variables from a cookie and whenever the variables change, write them to the cookie. Using a cookie also allows you to have your variables persist between browser sessions if this is desirable to you. If you don`t know how to do cookies, just do a search on the web for "javascript cookies". You`ll find ready to use code for reading and writing cookies.
If you have ASP or CGI available on your server, then your javascript can update hidden HTML Form variables that when submitted are read server-side and written back into the returning page javascript.
Another option that is kind of clumsy is to use either a parent, persistent window or a parent frame. You can read and write javascript variables between browser windows. So if you open up some kind of master window that then opens your main application window. Each child window can read and write its variables to the parent window. Of course if your user closes that annoying parent window--your variable store is gone!
If any of these options sound useful, let us know here and we can provide actual code examples.
|
|
|
|
|
|
|
|
|
|