Click to See Complete Forum and Search --> : passing variables between frames


IxxI
05-27-2003, 10:19 AM
Does this work?? I have two frames each referencing the same js file, does this mean that if one frame sets a variable the other frame will see that variable as set (if that makes sense)?

IxxI

khalidali63
05-27-2003, 10:33 AM
If both frames are importing same *.js file then no,because each will have their own instance.
ifyou want to use one js file in a way that both frames can see the code values being added /deleted in either of the frames,then you need to import the *.js file in the frameset page.

and reference the js file functions/variables using following pattern

parent.functionName()

or parent.variableName

IxxI
05-27-2003, 10:46 AM
Thanks Khalid,
Does that work the same for timeouts? If I have this.timeoutID2=window.setTimeout("parent.move()",500) in one frame and window.clearTimeout(this.timeoutID2) in another, should those be changed?

IxxI

khalidali63
05-27-2003, 10:50 AM
It looks correct to me.though,I'd need to look at the actual pages referencing these mthods and the actual js file.

IxxI
05-27-2003, 10:59 AM
EDIT: Sorry, ignore that one... ;)

IxxI

khalidali63
05-27-2003, 11:08 AM
you got it buddy...

Yes it will

parent .frameName.document.getElementById

IxxI
05-28-2003, 03:10 AM
EDIT: posted in a different thread, sort of unrelated really