Thomas Comiotto wrote:

On Jul 24, 2007, at 9:48 PM, Richard Frovarp wrote:

Thomas Comiotto wrote:
That one works now. Previously I was getting it has no properties or something like that and on an alert it came back undefined. If I do document.getElementsByTagName('body')[0].onkeydown = functionname, I can see it is registered using Firebug. However, having an alert/breakpoint for even entering the function doesn't trip.


Windows fire key events, elements don't.

--Thomas

Anyway to get around this?


No (and it even makes sense if you think about it:) - I didn't follow this one from the beginning, what are you trying to achieve?


Trying to prevent the backspace key from causing the browser to go back a page when editing, as this can cause a large number of problems. My original code looked like this:

<script type="text/javascript" src="/modules/editors/javascript/disablebackspace.js">&#160;</script> <page:body onkeydown="return checkBackspace(event)" onkeypress="return checkBackspace(event)" >

The goal is to move the code out of the body element so just including the script would do all of the work. So I need a way of registering those events/properties. But from what you're saying, that can't be done. Unless I put the events on the window I guess.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to