Click to See Complete Forum and Search --> : Can a script run another script in another document?


karayan
05-26-2003, 10:34 PM
Here's the scoop: I have two documents open (in two different frames if it matters). I need to have a Javascript function in document 1 run a function that resides in document 2. How can I do that? (The obvious alternative, to replicate the function in document 1, is extremely messy. That function uses lots of global variables whose value is not known in document 1.)

Any tricks?
Thanks.

George

khalidali63
05-26-2003, 10:56 PM
If I understand you correctly?

you can reference a function in another frame using the following syntax.

parent.frameName.functionName();

pass the parameters if required

karayan
05-26-2003, 11:07 PM
Thanks, it works great!

I guess, then, functions become methods supported under the frame/window that they are in. My JS book didn't tell me that.

Do you know where I can find the DEFINITIVE Javascript object model??

Thanks, again, Khalid.

khalidali63
05-26-2003, 11:09 PM
There are resources scattered all over the net.

I am sure you'll find this resource exceptionally handy.

http://www.echoecho.com/jsquickref.htm

Ohh btw..

You are welcome...:D