[Javascript] Event object in an iFrame

Peter-Paul Koch gassinaumasis at hotmail.com
Mon Jun 7 06:41:29 CDT 2004



>I have an .aspx page which displays, top and left navigation.  This page 
>also contains an iFrame which holds the main content. I am using the 
>onkeypress and onkeydown events to allow keyboard navigation.  The handlers 
>for these events in parent frame.
>
>The only way I can get access is to the event object is to pass the event 
>to the parent frame's hanler (shown below).  My question is, is there 
>another way to get a hold of this event object??

No. The iframe and its parent page are distinct pages, so you have to use 
cross-frame scripting (as you do) to pass anything from one page to the 
other. The pages don't share events.

What you're doing now is the best solution.

-------------------------------------------------------------------
ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
http://www.quirksmode.org/
Column "Keep it Simple": http://www.digital-web.com/columns/keepitsimple/
------------------------------------------------------------------

_________________________________________________________________
Hotmail en Messenger on the move 
http://www.msn.nl/communicatie/smsdiensten/hotmailsmsv2/




More information about the Javascript mailing list