You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
F99 mentions to beware "the presence of the .keycode attribute".
That looks like a DOM property accessor, and to the best of my knowledge, there is no (.)keycode attribute, assuming HTML is the host language. Note that DOM property accessors might yield different results than the getAttribute method for the reflected attribute.
It looks to me like “the .keycode attribute” could be replaced by “event.key” -- but that is not an ambitious fix.
IMO the minimal and least controversial viable fix would be just ".keyCode property" instead of ".keycode attribute". Just for accuracy. It can still be found in the wild, and it probably still works. It's anachronistic alright, but then, event handling nowadays is usually buried under a thick layer of "normalization" by libraries or frameworks. I doubt that this kind of code search is useful with eventTarget abstractions.
Using event as an identifier without full context in documentation examples is historically burdened and should be used with caution. Internet Explorer thought it would be cute to have a global event object without passing it into a handler function or method, and its lifeline was extended via the original Opera to present day Chromium.
Fun!
event // global object (if implemented; and property of the window object)
function handle_something(event) {
event // function parameter shadows global object (if implemented)
}
function handle_something() {
event // global object (if implemented), function parameter omitted or forgotten
}
F99 mentions to beware "the presence of the
.keycode
attribute".getAttribute
method for the reflected attribute.keyCode
.keyCode
has been deprecated since, eh, I'm not an archeologist. :-) A superficial search unveils a Stackoverflow question from 2016.The text was updated successfully, but these errors were encountered: