W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: [EventSource] Question on event type

From: Glenn Maynard <glenn@zewt.org>
Date: Thu, 8 Sep 2011 14:46:00 -0400
Message-ID: <CABirCh_nyYzhjX2J=vnCyykMGCFWwTVUQv3zaTxvEFmJgvHHwQ@mail.gmail.com>
To: Bryan Sullivan <blsaws@gmail.com>
Cc: public-webapps@w3.org
On Thu, Sep 8, 2011 at 1:56 PM, Bryan Sullivan <blsaws@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 the event is the first parameter to addEventListener.
It's also available with event.type, if you use the same function for
several listeners.

Glenn Maynard
Received on Thursday, 8 September 2011 18:46:35 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 13:55:44 UTC