Click to See Complete Forum and Search --> : Global variable


Djamboff
09-15-2003, 03:47 AM
Can I send variable (var u=...)from one .htm file to an other .htm file if they are parts of a frame.
For example if top,left and main are .htm files and index is frame with top,left and main sections, can I send variable declared in javascript in one of them and use it in an other?
Thanks. Valentin.

96turnerri
09-15-2003, 07:16 AM
yes it is possible to do that

Khalid Ali
09-15-2003, 07:22 AM
this is how you can achieve this.
suppose you have a global variable in frame left,

<script.....>

var leftName="This is left frame";

now you want to access it in topFrame frame...


parent.topFrame.leftName

should give you the value,
BTW try not to use top frame name because it is used to refer to the parent window,hence could create un wanted results.

Djamboff
09-16-2003, 09:00 AM
Thanks mr. Khalid . It works. I received the same result using hidden field of a form, but this is more natural way. Valentin.