window.addEventListener("keyup", eventkeyup(event, something), false);
function eventkeyup(event, something) {
//could not be able to get the event object here.
}
如何使用此功能访问事件?
答案 0 :(得分:0)
传递函数本身,而不返回其值undefined
。
window.addEventListener("keyup", eventkeyup(something), false);
function eventkeyup(something) {
return function(event){
// you have event and something here
}
}