📄 eventlistener.jsc
字号:
# language: JSVM2
/** * Copyright (c) 2000 World Wide Web Consortium, * (Massachusetts Institute of Technology, Institut National de * Recherche en Informatique et en Automatique, Keio University). All * Rights Reserved. This program is distributed under the W3C's Software * Intellectual Property License. This program is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. * See W3C License http://www.w3.org/Consortium/Legal/ for more details. */
package org.w3c.dom.events;
/**
* The EventListener class is the primary method for handling events.
* Users implement the EventListener class and register their listener
* on an EventTarget using the AddEventListener method. The users should also
* remove their EventListener from its EventTarget after they have completed
* using the listener.
* @class
*/
class EventListener (fHandle, oOwner)
{
this.handle = fHandle;
this.owner = (oOwner != null &&
typeof(oOwner) == "object") ? oOwner : null;
}
/**
* This method is called whenever an event occurs of the
* type for which the EventListener interface was registered.
* @param {Event} oEvt
*/
EventListener.prototype.handleEvent = function (oEvt)
{
var h = this.handle;
var o = this.owner || this;
h.call(o, oEvt);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -