Thanks for this, but I'm struggling.
I would like to call a function on key down in the window to test if it is
F12 (123).
With your code, how is addClickHandler called?
What is the object? document?
What function is func? The function I want to call?
Can I replace click with keyDown?
I've tried combinations of the above without success.
Your further help would be appreciated.
<hansschmucker@gmail.com> wrote in message
news:1134876907.687941.309110@g43g2000cwa.googlegr oups.com...[color=blue]
> it's not really wrong as far as I can tell... just terribly obsolete.
> By now there are two new APIs for that: attachEvent for MSIE and
> addEventListener for any standards compliant browser. You can use this
> function to make sure it works everywhere, just replace "click" with
> "keyUp". That'll work in any browser. Attention: for MSIE the event
> type is onXYZ, for the rest it's just XYZ: onclick VS click
>
> function addClickHandler(object,func){
> if( object.addEventListener ) {
> object.addEventListener("click",func,false);
> return 0;
> } else if ( object.attachEvent ) {
> object.attachEvent("onclick",func);
> return 0;
> } else {
> object.onclick = func;
> return 0;
> }
> return (-1);
> }
>[/color]
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com