Click to See Complete Forum and Search --> : script referencing in frames


jag_dish
12-23-2002, 12:23 AM
HI all,

I have a main frame which has left and right frames.
A javascript library is included in the main frame page

Now i want to use the functions in that library in the pages of right frame. How can i give a reference to the parent frames function in the src tag of <script>

Thanks in advance for any help!!!!!!!

ShrineDesigns
12-23-2002, 12:26 AM
window.opener.myFunction()

jag_dish
12-23-2002, 12:39 AM
hi,
thanks for ur reply...
window.opener can be used when u open a new window.
but i am not opening any new window.

moreover i am using a library in the main frame and in the right frame i want to refer to parent library

for example in the right window i'd like to hav something like this
<script src= reference to parent frame's js lib></script>.

khalidali63
12-23-2002, 12:51 AM
It doesn't look like that will be possible.
How come you can not import the lib into the other frames?

Khalid

jag_dish
12-23-2002, 01:12 AM
Hi khalidali,

Thanks for ur interest in the topic.

The fact is i dont want to load the same library for the two frames independently.

rather, i want to load it to client once and use that library in all frames.

any ideas??????

ShrineDesigns
12-23-2002, 03:58 AM
you might also try parent.myFunction()

is the function neccessary in the main frame ???

if not put the function in a new JS file and link it to where you need it

aepstar
12-23-2002, 05:20 AM
if ur main html has the javascript then refering to the function in that page would be ike this:

parent.document.myFunction()
or parent.myFunction()

or if the code is in left frame then

parent.leftFrame.document.myFunction() or
parent.leftFrame.myFunction()

success

jag_dish
12-23-2002, 05:25 AM
Hi aepstar,

I got it done jus an hour back in the same way.

But a Big thanks for ur reply.

Thanks to all who responded...