[Javascript] global variables in frames

Muchacho, Laurent (TWIi London) LMuchacho at twii.net
Wed Nov 27 07:55:21 CST 2002


Hi 
 
You will define the variable the same way you declare an other variable
var myVariable = 'myValue';
To access it will need to references the frame where you did declare the
variable 
you said you have 3 frames named(examples) frame1, frame2, frame3
let say you declare the variable in frame1
if you want to access the variable in the frame one you do :
document.frame1.myVariable
if you are in a other frame you do exactly the same
document.frame1.myVariable
and this will give you the value of the variable if you want to change it
you do : document.frame1.myVariable = 'newValue';
 
hope this help? 
 
Laurent
 

-----Original Message-----
From: Girish Chawla [mailto:cgirish at pal-it.com]
Sent: 27 November 2002 13:44
To: javascript at LaTech.edu
Subject: [Javascript] global variables in frames


Hi,

I have a window with 3 frames. 
I want to access a global variable "xyz"  from all the
frame and I want to change the value from any frame.

How do I define this variable?
thanks in advance..
G





DISCLAIMER - The preceding e-mail message (including any attachments)
contains information that may be confidential, may be protected by the
attorney-client or other applicable privileges, or may constitute non-public
information.  It is intended to be conveyed only to the designated
recipient(s) named above.  If you are not an intended recipient of this
message, or have otherwise received it in error, please notify the sender by
replying to this message and then delete all copies of it from your computer
system.  Any use, dissemination, distribution, or reproduction of this
message by unintended recipients is not authorized and may be unlawful. The
contents of this communication do not necessarily represent the views of
this company.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20021127/92ac3402/attachment.htm>


More information about the Javascript mailing list