Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global Variables

Status
Not open for further replies.

danfood

Programmer
Aug 8, 2001
32
0
0
GB
How does one assign global variables in JS?

I need to pass them onto another HTML page with JS in.

Ta.
Dan
 
global variables - all variables that are defined outside of functions, this way:
<script>
var GlobalVariable=&quot;geeee&quot;
</script>

about passing these variables - this forum have a couple of faqs on this subject, take a look at faqs area

Victor
 
if I know what you are asking, you cant directly do that. but first, let me check. you are asking if you can declare a variable that is global to the browser, so another html page can access it.

if this is true, you can send this variable many ways. you can send it using the search string on the location, for example. this requires some really fancy string handling, tho.

you could also use a form to send the information, which makes the sending part easier, but the information is still sent via the search string, so you would still have to parse it for your variable names and values theEclipse
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top