Re: How to get a list of the events an object can emit, in Firefox?
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Mon, 09 Mar 2009 13:58:12 +0100
Good morning ;-)
Sam Dutton replied to an article written over a month ago (no offense taken):
Thomas 'PointedEars' Lahn wrote:
Sam wrote:
I'm trying to find out theeventsthat a video element can emit inWhat is a video element?
Firefox 3.1 (other than by looking at the documentation!)
For page elements in Internet Explorer I can use...Probably you mean (proprietary) *event-handler properties* instead.
for (prop in obj)
document.write(prop);
.... and this gives alistofevents(in the form of onclick, etc.)
In Firefox, I get alistof properties this way, but noevents.
The naming in (the) MSHTML (documentation) is misleading.
Am I missing something obvious?Yes.
[...]
2. The object iterated over is a *host object*.
[...]
4. You seem to have forgotten to declare `prop', which is error-prone:
for (var prop in obj)
Thanks for your response.
Thanks for quoting properly next time. <http://jibbering.com/faq/#posting>
Excuse my ignorance, but what does 2. mean?: "The object iterated over
is a *host object*"
It means exactly that (the asterisks mark the emphasis). See the ECMAScript
Language Specification, Edition 3 Final, sections 4.3.8 and 8.6.2. What it
means for your approach is that you cannot assume that this will work; in
fact, it might as well break.
HTML 5 has a video and audio elements, which are supported (more or
less) by new or beta browsers.determine
Which because of the latter are certainly unwise to use on the Web. As for
the former, HTML 5 is not even a Candidate Recommendation yet, let alone
that Web developers or responsible working groups would have come to an
agreement about whether it is a rather good idea or a recipe for disaster
instead. (IMHO, a specification for DOM scripting does not belong in a
specification for a markup language to begin with.)
I'm still wondering if there's a way to find a list of the events (if
that's the right word!)
That is the right word, however `on...' are named event handlers for those
events, and the values that you assign to them (callable objects) are named
event listeners. Always keep those separate to avoid confusion (MSDN
unfortunately didn't.)
that an element can emit. In the case of the video and audio elements,
this means timeupdated, seeked, etc.
That is probably highly dependent on the required and used media plugins,
and therefore documented there. RTFM. However, it might be possible to
determine with a feature test which properties the corresponding host object
supports in the respective runtime environment.
RTFFAQ: <http://jibbering.com/faq/>
PointedEars
.
- References:
- Re: How to get a list of the events an object can emit, in Firefox?
- From: Sam Dutton
- Re: How to get a list of the events an object can emit, in Firefox?
- Prev by Date: Re: Javascript Clear Select Options Fast
- Next by Date: Re: Javascript Clear Select Options Fast
- Previous by thread: Re: How to get a list of the events an object can emit, in Firefox?
- Next by thread: Re: How to get a list of the events an object can emit, in Firefox?
- Index(es):
Relevant Pages
|
Loading