In article <bt************@ID-174912.news.uni-berlin.de>, "Fabian"
<la****@hotmail.com> writes:
Suppose I have a page, call in parent.html . Inside, there is an iframe,
call it child.html . I want it so that in response to a keyboard event
in either parent or child, child.html will respond in a particular way.
Do I need to use a different set of code for each html page, or can I
reuse the same code?
With a well-written function, you can reuse the same code, even use only one
function.
If the code is different, what are the fundamental differences in code?
The references. The parent window has to reference the child, the child window
only has to reference itself.
How do I make one frame respond to events in a different frame as a
general rule?
You add the event handler to the page that you want to trap the event from, and
then change the other page dynamically.
If the function is in child.html, and you have the event handlers working as
you want, simply change the event handlers in parent.html to point to the
function in child.html
parent.frames['IFrameName'].showMe()
And in child.html:
function showMe(){alert('This is in the IFrames page')}
Thats assuming you have the IFrame name="IFrameName"
Pass parameters appropriately.
--
Randy