FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

event inside iframe call functions in the root HTML

 


Mgccl
what I want is anything inside a iframe could call a function in the HTML that contains the iframe
here is an example

http://lf2.l2p.net/ladder/
go there... click a person's name(like... Mgccl)
it jumps out a div contains a iframe....
and then, in the iframe.. click the tab fight
and you could see player name again
click something other than mgccl...
and you will find that window will be contained inside that iframe...
is there anyway to make that window outside that iframe? in the root HTML file?
Esch
Sure, just run the following Javascript from somewhere within the page pointed to by the iframe:

Code:
top.location = 'mypage.html';

Your top page (i.e. the one which contains the iframe) will be redirected to the page you specify. You can also change arbitrary elements on the containing page using top.document.getElementById().
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.