是否有可能从handleEvent中的事件获取窗口对象? [英] Is it possible to get the window object from the event in handleEvent?
问题描述
在问题中...如何从窗口
范围中激发的事件获取窗口
例如:
pre $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $我们可以从事件
}
中得到它,我可以得到窗口
从其他API的对象。我想知道是否有可能从
使用handleEvent的代码片段
event.view
event.view
event.target.ownerDocument.defaultView
event.target
event.originalTarget.ownerGlobal
活动.originalTarget (N标准)
As in the question... how to get the window
object from an event fired in the window
scope for example:
handleEvent: function(event) {
// is window object available here and can we get it from event
}
I can get the window
object from other APIs. I was wondering if it was possible to get it from the fired event
.
Reference:
handleEvent
Code Snippet using handleEvent
I found out the answer ... any of these will get the window
object from the event
event.view
event.view
event.target.ownerDocument.defaultView
event.target
event.originalTarget.ownerGlobal
event.originalTarget (Non-standard)
这篇关于是否有可能从handleEvent中的事件获取窗口对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!