W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2010

[whatwg] Question regarding event: in server-sent events

From: Nicholas Zakas <nzakas@yahoo-inc.com>
Date: Tue, 19 Oct 2010 09:58:34 -0700
Message-ID: <B66541E954ECF146AD8CA69D34A283FF256EFAFB3F@SP2-EX07VS02.ds.corp.yahoo.com>
Thanks for the clarifications, this helps a lot.

Commander Lock: "Dammit Morpheus, not everyone believes what you believe!"
Morpheus: "My beliefs do not require them to."

-----Original Message-----
From: Anne van Kesteren [mailto:annevk@opera.com] 
Sent: Tuesday, October 19, 2010 12:54 AM
To: whatwg at whatwg.org; Nicholas Zakas
Subject: Re: [whatwg] Question regarding event: in server-sent events

On Mon, 18 Oct 2010 19:38:46 +0200, Nicholas Zakas <nzakas at yahoo-inc.com>  
> 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
Received on Tuesday, 19 October 2010 09:58:34 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:27 UTC