codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  variables.  Archive Import (dead meat) at 21:40 on Monday, July 21, 2003
 

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

  Re: variables.  Troy Wolf at 22:54 on Tuesday, July 22, 2003
 

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.
Troy Wolf: site expert
Shiny Solutions









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: onload event
•  Active Widgets
•  Re: onmouseover change image and text
•  Line Printer Interface
•  import contacts of msn/yahoo
•  Call windows apps from web apps
•  Re: ASP.NET web controls
•  netscape 6 browser problem
•  Re: Print .doc file from the website using System.Diagnostics.Process


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005