Calling function in oyher frame

P

Peter Crom

Hi everybody,

I met an interesting problem.

On my site people can browse through many pages that are viewed in a set of
frames.
Now I would like to avoid reloading the rather large .js file everytime a
new page is viewed. (takes a few seconds on an ordinary telephone
connection).
Therefore I load it at the central entry-point once when I fill the frame
kop (referred to as 'top.kop').

Now from the different other frames, when they are loaded, they call a
setup-routine with:
<BODY ONLOAD="top.kop.setup(document)">

This works fine in IE, but not in NN 7.0

NN does not recognise setup() as a function available in top.kop

How come and what can be done about it...

By the way, merry Christmas, everybody!!!
Don't give up your family-life for questions like the above...
 
B

Brian Genisio

Peter said:
Hi everybody,

I met an interesting problem.

On my site people can browse through many pages that are viewed in a set of
frames.
Now I would like to avoid reloading the rather large .js file everytime a
new page is viewed. (takes a few seconds on an ordinary telephone
connection).
Therefore I load it at the central entry-point once when I fill the frame
kop (referred to as 'top.kop').

Now from the different other frames, when they are loaded, they call a
setup-routine with:
<BODY ONLOAD="top.kop.setup(document)">

This works fine in IE, but not in NN 7.0

NN does not recognise setup() as a function available in top.kop

How come and what can be done about it...

By the way, merry Christmas, everybody!!!
Don't give up your family-life for questions like the above...

This is because, if the frame is named "kop", you need to use the more
cross-browser way to access it (the other notation is specific to IE):

top.frames["kop"] ... which yields top.frames["kop"].setup(document)

Hope I got it right... without seeing the code, it is difficult to tell
for sure.

Brian
 
E

Eric Bohlman

On my site people can browse through many pages that are viewed in a
set of frames.
Now I would like to avoid reloading the rather large .js file
everytime a new page is viewed. (takes a few seconds on an ordinary
telephone connection).

You can achieve that by linking to the script (<script src="...">) rather
than including its source in the individual pages. That way it will be
cached the first time it's loaded. It will also make maintaining the
script easier, since any changes only have to be made in one place.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top