i created a webpage which has multiple frames with frameset.
But the problem is to catch the onkeydown event.
If i describe this event on the head part of top frameset, nothing happens.
And If i put the script in the child frame the same code sholud be written as many times as the number of frames.
Now I wrote the exatly same code in each frame, and it works but I don't want to keep it in that way cause in case i modify the code i should do it three times.
I hope somebody can help me.
Here's simple example of the code i'm repeating multiple times.
thanx,
But the problem is to catch the onkeydown event.
If i describe this event on the head part of top frameset, nothing happens.
And If i put the script in the child frame the same code sholud be written as many times as the number of frames.
Now I wrote the exatly same code in each frame, and it works but I don't want to keep it in that way cause in case i modify the code i should do it three times.
I hope somebody can help me.
Here's simple example of the code i'm repeating multiple times.
| Code: |
|
<script language="javascript"> // function that stops palying when "esc" key is pressed function myKeyDown(){ if(event.keyCode == 27) { parent.player.stop(); } } document.onkeydown=myKeyDown; </script> |
thanx,
