本文讲解了构建小部件的基本步骤,包括动态事件注册和服务器通信。
This article has taken you through the basic steps of constructing a widget, including dynamic event registration and server communication.
要从同一个对象接收多个事件,你必须为每个事件注册你的侦听器。
To receive multiple events from the same object, you must register your listener for each event.
当您关闭外壳程序,或由于某种原因关闭其自身上时,不见事件注册了。
When you close the shell or it closes on its own for some reason, the event registration is gone.
如果你想继续按顺序阅读关于事件的文章,请继续下一篇高级事件注册模型。
If you wish to go through all event pages in order, you should now continue with the Advanced models page.
这两种事件注册的方式其实完全一样的,只是第二种方式会使代码看起来凌乱一点。
The two ways of registering event handlers are completely the same, the only difference is that the second one clutters your code less.
在内嵌的事件注册模式中,事件处理器作为属性加到它所在的HTML元素中,比如。
In the inline event registration model, event handlers are added as attributes to the HTML elements they were working on, like.
XML标记的不同部分(如起始和结束标记、文本、实体)触发特殊的事件,然后为这些事件注册处理程序代码。
You register handler code for specific events that are triggered by different parts of XML markup (such as start and end tags, text, and entities).
XML标记的不同部分(如起始和结束标签、文本、实体)触发特殊的事件,开发人员为这些事件注册处理程序代码。
The developer registers handler code for specific events that are triggered by different parts of XML markup (such as start and end tags, text, entities).
因为Netscape3已经支持了新的事件注册模型,所以在浏览器大战之前,它的模型就是实际上的标准了。
Because Netscape 3 already supported the new registration model, it was a DE facto standard before the Browser Wars.
在微软的事件注册模型中,对我而言这是最严重的问题,严重到我从来不会使用它,更不用说只支持IE浏览器的程序了。
This is the most serious problem with the Microsoft event registration model and for me it's reason enough never to use it, not even in IE/Win only applications.
指向要调用的回调函数的指针(对于一种或多种事件类型)——为每种特定的事件注册一个回调函数,然后将在事件发生时调用这些函数。
Pointer to the callback function to be invoked (for one or more event Types) — for each specific event, register a callback function, and then these functions are called when the event occurs.
先选择一个事件注册模型,然后确定这个事件会在所有的浏览器里面触发,然后读出正确的属性,最后解决事件触发顺序问题-如果有的话。
First choose an event registration model, then make sure the event is accessed by all browsers, then read out the correct properties and then solve event order problems -if any occur.
首先选择一种事件注册模型,确保所有的浏览器都支持该事件,随后去读取所需的事件属性,期间,如果存在兼容性问题的话还需要去解决。
First choose an event registration model, then make sure the event is accessed by all browsers, then read out the correct properties and then solve event order problems - if any occur.
例如,假设Listener1是在某个控件上为t1类型的事件注册的第一个监听器,而Listener 2是在这个控件上为相同的t1类型的事件注册的第二个监听器。
For example, say a Listener 1 is first registered on a widget for event type t1 followed by a Listener 2 for the same event type t1.
在本文中,我们将展示如何用一个特定的连接端口注册CIM事件处理程序以避免增加复杂度。
In this article, we show you how to register CIM event handlers with a a single specific connection port to avoid added complexity.
浏览器通过调用预先注册的函数来传递事件。
Browsers pass events by calling functions that were registered in advance.
定义一个事件侦听器并将其注册至视图。
当在目标CIM 服务器上注册 CIM事件处理程序时,我们能够获得每个建立的侦听程序的连接信息。
When the CIM event handlers are registered on the target CIM server, we were able to get the connection information of each established listener.
这是首选的,因为很容易注册(和注销)事件函数,而且可以将浏览器处理的多个已注册函数链接起来。
This is your first choice because it's easy to register (and unregister) event functions, and chaining through multiple registered functions is handled by the browsers.
有些充当回调机制的容器事件,也注册到了这里。
Some container events, which act as call-back mechanisms, are registered here.
许多应用程序注册这些事件以便用它们自己的方式报错。
Many applications register for these events to report errors in their own way.
菜单会自行处理它们的事件,所以你不必为你菜单中的项目注册事件侦听器。
Menus also handle their own events, so there's no need to register event listeners on the items in your menu.
它是更为复杂的代码,要求扩展类才能注册事件侦听程序。
It's more complicated code that requires extending a class to register an event listener.
然后发生该事件的通知会发送给控件中为该事件类型注册的所有监听器,发送顺序是这些监听器在控件上的注册顺序。
This is followed by notification of event occurrence to all listeners of the widget registered for that same event type and in the order in which the listeners were registered on widget.
每个阶段中,路径中的任何元素都可以注册为事件观测者,从而能够触发事件处理程序。
During each phase, any element along the path can be registered as an observer of the event, and can thus trigger an event handler.
对HTML元素的事件处理程序的注册的方法也有很大的变化。
Also, the way of registering event handlers to HTML elements was changed.
大多数应用程序都注册这些事件。
编写将用于解释ui中的更改并相应修改ACL和注册中心的事件处理程序和服务方法。
Writing event handlers and service methods that will interpret changes in the UI and modify ACLs and the registry accordingly.
返回到清单7,需要做的最后一件事是注册事件处理程序。
Going back to Listing 7, the last thing you do is register event handlers. You are registering for online and offline events.
API还支持一种事件机制,您可使用该机制注册为在特定事件(比如域的启动、中止、恢复或停止)发生时获得通知。
The API also supports an event mechanism with which you can register to be notified of particular events (such as a domain being booted, suspended, resumed, or stopped).
应用推荐