Calling a Javascript function from a different frame
by z3n on Jun.09, 2009, under Coding, Tips & Hints
Problem:
How to call a function from a different frame/iframe ?
Solution:
It depends where the function is, when it’s on the main frame, or if you’re calling a funcion that’s on _top from inside a iframe:
top.function();
If you’re calling a function from a frame to another:
parent.frames['frame_name'].function();
or
parent.frames[frame_number].function();
Problema:
Como chamar uma função em outro frame/iframe ?
Solução:
Depende de onde estiver a função, se estiver no _top (se estiver sendo chamada de dentro de um iframe):
top.função();
Ou se for de um frame para outro:
parent.frame['nome_do_frame'].função();
ou
parent.frame[número_do_frame].função();