~ overflow ~

Calling a Javascript function from a different frame

by z3n on Jun.09, 2009, under Coding, Tips & Hints English

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();

:, , , ,


No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!