[whatwg] Question regarding event: in server-sent events
Anne van Kesteren
annevk at opera.com
Tue Oct 19 00:54:12 PDT 2010
On Mon, 18 Oct 2010 19:38:46 +0200, Nicholas Zakas <nzakas at yahoo-inc.com>
wrote:
> Just for my own understanding, what you're saying is:
>
> 1) Any event name in the stream must be a valid event name in that it
> must not have spaces, special characters, etc. (The wording in the spec
> made me think that it must be an event name that is listed in the DOM
> Events spec, such as click.)
Yes, although it is not clear whether per the current DOM Events
specification an event name with a space would be invalid.
> 2) When you define an custom event name, this still fires the message
> event with event.type set to the custom event name.
Well, it dispatches an event that uses the MessageEvent interface. But
e.g. a function attached to onmessage will not be invoked, as the event is
not named message, but something else. So you need
obj.addEventListener(customEvent, ...).
--
Anne van Kesteren
http://annevankesteren.nl/
More information about the whatwg
mailing list