Re: [EventSource] Question on event type

2012-05-08 Thread Ian Hickson
On Thu, 8 Sep 2011, Bryan Sullivan wrote: OK, maybe I'm getting closer to understanding this. From your example, when the event field is set, it's not a message event that is dispatched but an event of type event name, so in order to see those events, I need to use the addEventListener

[EventSource] Question on event type

2011-09-08 Thread Bryan Sullivan
Hi all, Trying to implement a test for eventsource, it's unclear to me in the sequence below, how item 4 is to be implemented and coded for by a developer: (extract from http://www.w3.org/TR/eventsource/) When the user agent is required to *dispatch the event*, then the user agent must act as

Re: [EventSource] Question on event type

2011-09-08 Thread Glenn Maynard
On Thu, Sep 8, 2011 at 1:16 PM, Bryan Sullivan bls...@gmail.com wrote: The event type for the MessageEvent is message (in all browsers I have tested, and there is no other type attribute defined for MessageEvent. So if I send from my server a line event: foo\n, I would expect from reading above

Re: [EventSource] Question on event type

2011-09-08 Thread Bryan Sullivan
Thanks for the help. So when you say the name of the event, how in JavaScript do I access the name of the event, e.g. to test it? Accessing the data (event.data) works, but how do access the name? In your example, event.data is output but I don't see you accessing or using the event name.

Re: [EventSource] Question on event type

2011-09-08 Thread Glenn Maynard
On Thu, Sep 8, 2011 at 1:56 PM, Bryan Sullivan bls...@gmail.com wrote: Thanks for the help. So when you say the name of the event, how in JavaScript do I access the name of the event, e.g. to test it? Accessing the data (event.data) works, but how do access the name? The type (or name) of

Re: [EventSource] Question on event type

2011-09-08 Thread Bryan Sullivan
That would seem to be the obvious way to access it, but does not seem to be working for current implementations of eventsource. That's why I was unsure of how to access it. I guess there are some other issues at hand here. I need to figure out what they are first, and will start another thread for

Re: [EventSource] Question on event type

2011-09-08 Thread Glenn Maynard
On Thu, Sep 8, 2011 at 3:13 PM, Bryan Sullivan bls...@gmail.com wrote: That would seem to be the obvious way to access it, but does not seem to be working for current implementations of eventsource. That's why I was unsure of how to access it. I guess there are some other issues at hand here.

Re: [EventSource] Question on event type

2011-09-08 Thread Bryan Sullivan
OK, maybe I'm getting closer to understanding this. From your example, when the event field is set, it's not a message event that is dispatched but an event of type event name, so in order to see those events, I need to use the addEventListener interface for the eventsource object (they will not