473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

declaring global variables in javascript

how can i decalre global variables in javascript so that the value which is held by global variable is carried to and fro between html pages to display some items based upon the value in the global variable.
Aug 28 '06 #1
1 9218
Banfa
9,065 Expert Mod 8TB
You can't, javascript variables are local to the age they are on.

What you can do is

pass variables using a cookie to store them

pass variables on the URL for the next page to pick up (either by manually writting the URL or through form submission).
Aug 28 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Andrew V. Romero | last post by:
I have been working on a function which makes it easier for me to pull variables from the URL. So far I have: <script language="JavaScript"> var variablesInUrl; var vArray = new Array(); ...
8
by: lawrence | last post by:
I'm learning Javascript. I downloaded a script for study. Please tell me how the variable "loop" can have scope in the first function when it is altered in the second function? It is not defined...
2
by: ross.oneill | last post by:
Hi, I am having trouble with a simple task of declaring a variable. Is this possible? Here is what I want to do. DECLARE start_date date; DECLARE end_date date; SET start_date =...
4
by: Lucy | last post by:
In the Declarations section of a form's code module, what is the difference between the following: Dim Flag As Boolean Public Flag As Boolean Private Flag As Boolean Thanks!
2
by: majel | last post by:
I just read an older post that described declaring global variables. I tried this but I'm getting an error and the text stays red. What am I doing wrong? This code is behind a form. Thanks. ...
2
by: TARUN | last post by:
I have a question about declaring the Global.ascx: In VS.NET I create a Solution, and there are 4 projects under it. They are put under 4 folders, but web pages would be called across the 4...
8
by: SM | last post by:
I've always wonder if there is diference when declaring and initializing a varible inside/outside a loop. What's a better practice? Declaring and initializing variables inside a loop routine,...
2
by: MLH | last post by:
I'm wondering about Public VS Global kewords that can be used in procedures inside global modules saved/viewd in the modules tab of the database window. Is it pretty much the same thing to use one...
4
by: Sister Ray | last post by:
I've searched for a way to this in a lot of forums. Haven't found a solution for this, however I've found a work around. Declaring a public object and then adding the variables i want as members...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.