Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] global variables in frames


  • From: javascript@xxxxxxxxxx (Muchacho, Laurent (TWIi London))
  • Subject: [Javascript] global variables in frames
  • Date: Wed, 27 Nov 2002 13:55:21 -0000

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2961C.A0545FD0
Content-Type: text/plain;
	charset="iso-8859-1"

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@xxxxxxxxxx]
Sent: 27 November 2002 13:44
To: javascript@xxxxxxxxxx
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.

------_=_NextPart_001_01C2961C.A0545FD0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>Hi=20
</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D507544413-27112002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>You=20
will define the variable the same way you declare an other=20
variable</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>var=20
myVariable =3D 'myValue';</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>To=20
access it will need to references the frame where you did declare the =
variable=20
</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>you=20
said you have 3 frames named(examples) frame1, frame2,=20
frame3</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>let=20
say you declare the variable in frame1</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>if you=20
want to access the variable in the&nbsp;frame one you do :=20
&nbsp;document.frame1.myVariable</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>if you=20
are in a&nbsp;other frame you do exactly the same=20
document.frame1.myVariable</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>and=20
this will give you the value of the variable if you want to change it =
you do :=20
document.frame1.myVariable =3D 'newValue';</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D507544413-27112002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D507544413-27112002>hope=20
this help? </SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D507544413-27112002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D507544413-27112002>Laurent</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D507544413-27112002></SPAN></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> Girish Chawla=20
  [mailto:cgirish@xxxxxxxxxx]<BR><B>Sent:</B> 27 November 2002=20
  13:44<BR><B>To:</B> javascript@xxxxxxxxxx<BR><B>Subject:</B> =
[Javascript]=20
  global variables in frames<BR><BR></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Hi,<BR><BR>I have a window with 3 =
frames. <BR>I=20
  want to access a global variable "xyz"&nbsp; from all the<BR>frame =
and I want=20
  to change the value from any frame.<BR><BR>How do I define this=20
  variable?<BR>thanks in=20
advance..<BR>G<BR><BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>
<BR>
<BR>

<P><B><FONT SIZE=3D2 FACE=3D"Arial">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.</FONT></B></P>

------_=_NextPart_001_01C2961C.A0545FD0--