I thought you couldn't pass arguments when you tie a function to an event-property like that? Or is the "event" argument different?
mceppi - the IE equivalent of the which property is keyCode, I believe. That's what it is for keydown, anyway. I'm not sure if which is W3C. Cross-browser would go something like this (it's wordy, but one line):
mceppi: sorry I don't have enough browsers to test it(only firefox)
korisu: It's the same as function(arg1, arg2, e) just with a different name. Because if I put "event" as an arguement then it can be useful in IE too as window is not essential. so function(event){ alert(event.which); }
mceppi - the IE equivalent of the which property is keyCode, I believe. That's what it is for keydown, anyway. I'm not sure if which is W3C. Cross-browser would go something like this (it's wordy, but one line):
alert('ctrl-clicked');
}
korisu: It's the same as function(arg1, arg2, e) just with a different name. Because if I put "event" as an arguement then it can be useful in IE too as window is not essential. so
function(event){
alert(event.which);
}
is the same as
function(){
alert(window.event.which);
}
in IE.